diff options
author | David Chisnall <csdavec@swan.ac.uk> | 2012-04-11 17:24:05 +0000 |
---|---|---|
committer | David Chisnall <csdavec@swan.ac.uk> | 2012-04-11 17:24:05 +0000 |
commit | 5d70cfddc8a8a450d1425e190f10512a51352e5d (patch) | |
tree | 9154298ae7aab4b2eee68413d5c15fcdb2ce6345 /test/CodeGenCXX/atomicinit.cpp | |
parent | adf7c854380cecb649e64a6ea1b5dbaf166a4365 (diff) |
Make __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/atomicinit.cpp')
-rw-r--r-- | test/CodeGenCXX/atomicinit.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/atomicinit.cpp b/test/CodeGenCXX/atomicinit.cpp index 17c5b62a3a..63e38118fe 100644 --- a/test/CodeGenCXX/atomicinit.cpp +++ b/test/CodeGenCXX/atomicinit.cpp @@ -10,3 +10,16 @@ void A::v(int j) { i = j; } // Initialising atomic values should not be atomic // CHECK-NOT: store atomic A::A(int j) : i(j) {} + +struct B { + int i; + B(int x) : i(x) {} +}; + +_Atomic(B) b; + +// CHECK: define void @_Z11atomic_initR1Ai +void atomic_init(A& a, int i) { + // CHECK-NOT: atomic + __atomic_init(&b, B(i)); +} |