diff options
author | Chris Lattner <sabre@nondot.org> | 2010-09-21 23:24:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-09-21 23:24:52 +0000 |
commit | 7cf46bfda055c1d5961e01c085fd13a76bc9614f (patch) | |
tree | 031fb6f21bef4e0d2fc2b19e266d16e0110a9e02 /clang/test/CodeGen/atomic.c | |
parent | 65dce5eeeea1ef72c2a30bdc60870c9136f25090 (diff) | |
download | bcm5719-llvm-7cf46bfda055c1d5961e01c085fd13a76bc9614f.tar.gz bcm5719-llvm-7cf46bfda055c1d5961e01c085fd13a76bc9614f.zip |
fix __sync_bool_compare_and_swap to work with address-space qualified types.
llvm-svn: 114498
Diffstat (limited to 'clang/test/CodeGen/atomic.c')
-rw-r--r-- | clang/test/CodeGen/atomic.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/atomic.c b/clang/test/CodeGen/atomic.c index 88a96568a43..f194ec6afb6 100644 --- a/clang/test/CodeGen/atomic.c +++ b/clang/test/CodeGen/atomic.c @@ -122,8 +122,19 @@ int atomic(void) { return old; } +// CHECK: @release_return void release_return(int *lock) { // Ensure this is actually returning void all the way through. return __sync_lock_release(lock); // CHECK: volatile store i32 0, i32* } + + +// CHECK: @addrspace +void addrspace(int __attribute__((address_space(256))) * P) { + __sync_bool_compare_and_swap(P, 0, 1); + // CHECK: call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 true) + // CHECK: call i32 @llvm.atomic.cmp.swap.i32.p256i32(i32 addrspace(256)* %tmp, i32 0, i32 1) + // CHECK: call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 true) +} + |