summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/2010-01-13-MemBarrier.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/2010-01-13-MemBarrier.c')
-rw-r--r--clang/test/CodeGen/2010-01-13-MemBarrier.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/2010-01-13-MemBarrier.c b/clang/test/CodeGen/2010-01-13-MemBarrier.c
new file mode 100644
index 0000000..c2b0acd
--- /dev/null
+++ b/clang/test/CodeGen/2010-01-13-MemBarrier.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// XFAIL: sparc
+// rdar://7536390
+
+typedef unsigned __INT32_TYPE__ uint32_t;
+
+unsigned t(uint32_t *ptr, uint32_t val) {
+ // CHECK: @t
+ // CHECK: atomicrmw xchg i32* {{.*}} seq_cst
+ return __sync_lock_test_and_set(ptr, val);
+}