From 7cf46bfda055c1d5961e01c085fd13a76bc9614f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Sep 2010 23:24:52 +0000 Subject: fix __sync_bool_compare_and_swap to work with address-space qualified types. llvm-svn: 114498 --- clang/test/CodeGen/atomic.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/test/CodeGen/atomic.c') 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) +} + -- cgit v1.2.3