summaryrefslogtreecommitdiff
path: root/test/CodeGen/atomic_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/atomic_ops.c')
-rw-r--r--test/CodeGen/atomic_ops.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/atomic_ops.c b/test/CodeGen/atomic_ops.c
index 29009bef894c..980ecd20e660 100644
--- a/test/CodeGen/atomic_ops.c
+++ b/test/CodeGen/atomic_ops.c
@@ -1,4 +1,6 @@
+// XFAIL: hexagon
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple mips-linux-gnu -emit-llvm %s -o - | FileCheck %s
void foo(int x)
{
@@ -16,3 +18,21 @@ void foo(int x)
// CHECK: {{(cmpxchg i16*|i1 @__atomic_compare_exchange\(i32 2, )}}
}
+
+extern _Atomic _Bool b;
+
+_Bool bar() {
+// CHECK-LABEL: @bar
+// CHECK: %[[load:.*]] = load atomic i8, i8* @b seq_cst
+// CHECK: %[[tobool:.*]] = trunc i8 %[[load]] to i1
+// CHECK: ret i1 %[[tobool]]
+ return b;
+}
+
+extern _Atomic(_Complex int) x;
+
+void baz(int y) {
+// CHECK-LABEL: @baz
+// CHECK: {{store atomic|call void @__atomic_store}}
+ x += y;
+}