summaryrefslogtreecommitdiff
path: root/test/Sema/atomic-requires-library-error.c
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-05-28 17:37:39 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-05-28 17:37:39 +0000
commit538bbe597b935a74d95c668ad209536753f13481 (patch)
tree9519b5280fc14b263bbcf1b230c36afdd4e80989 /test/Sema/atomic-requires-library-error.c
parent4e9179a3d0ec612a4d540281020b200254348a6b (diff)
downloadclang-538bbe597b935a74d95c668ad209536753f13481.tar.gz
Patch to issue error when target of MacOS and iOS
does not support large load/store of atomic objects. // rdar://13973577 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/atomic-requires-library-error.c')
-rw-r--r--test/Sema/atomic-requires-library-error.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Sema/atomic-requires-library-error.c b/test/Sema/atomic-requires-library-error.c
new file mode 100644
index 0000000000..b0aa278354
--- /dev/null
+++ b/test/Sema/atomic-requires-library-error.c
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 %s -triple=i686-apple-darwin9 -verify
+// rdar://13973577
+
+struct foo {
+ int big[128];
+};
+struct bar {
+ char c[3];
+};
+
+struct bar smallThing;
+struct foo bigThing;
+_Atomic(struct foo) bigAtomic;
+
+void structAtomicStore() {
+ struct foo f = {0};
+ __c11_atomic_store(&bigAtomic, f, 5); // expected-error {{atomic store requires runtime support that is not available for this target}}
+
+ struct bar b = {0};
+ __atomic_store(&smallThing, &b, 5);
+
+ __atomic_store(&bigThing, &f, 5);
+}
+
+void structAtomicLoad() {
+ struct foo f = __c11_atomic_load(&bigAtomic, 5); // expected-error {{atomic load requires runtime support that is not available for this target}}
+ struct bar b;
+ __atomic_load(&smallThing, &b, 5);
+
+ __atomic_load(&bigThing, &f, 5);
+}