diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-07-31 06:31:19 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-07-31 06:31:19 +0000 |
| commit | 77be48ac4744554b08b9a6587a4ade8601c9cc90 (patch) | |
| tree | c1087a1b801effbd2418a6b09d1e749410ea6590 /clang/test/CodeGen | |
| parent | c537bd2da4c07c56dfa49a8bc593e4e61a84c5d2 (diff) | |
| download | bcm5719-llvm-77be48ac4744554b08b9a6587a4ade8601c9cc90.tar.gz bcm5719-llvm-77be48ac4744554b08b9a6587a4ade8601c9cc90.zip | |
PR18097: Support initializing an _Atomic(T) from an object of C++ class type T
or a class derived from T. We already supported this when initializing
_Atomic(T) from T for most (and maybe all) other reasonable values of T.
llvm-svn: 214390
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/c11atomics.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CodeGen/c11atomics.c b/clang/test/CodeGen/c11atomics.c index 5c761b13749..f4c9522cbdb 100644 --- a/clang/test/CodeGen/c11atomics.c +++ b/clang/test/CodeGen/c11atomics.c @@ -12,6 +12,9 @@ // they're sufficiently rare that it's not worth making sure that the semantics // are correct. +// CHECK: @testStructGlobal = global {{.*}} { i16 1, i16 2, i16 3, i16 4 } +// CHECK: @testPromotedStructGlobal = global {{.*}} { %{{.*}} { i16 1, i16 2, i16 3 }, [2 x i8] zeroinitializer } + typedef int __attribute__((vector_size(16))) vector; _Atomic(_Bool) b; @@ -224,6 +227,7 @@ void testComplexFloat(_Atomic(_Complex float) *fp) { } typedef struct { short x, y, z, w; } S; +_Atomic S testStructGlobal = (S){1, 2, 3, 4}; // CHECK: define arm_aapcscc void @testStruct([[S:.*]]* void testStruct(_Atomic(S) *fp) { // CHECK: [[FP:%.*]] = alloca [[S]]*, align 4 @@ -272,6 +276,7 @@ void testStruct(_Atomic(S) *fp) { } typedef struct { short x, y, z; } PS; +_Atomic PS testPromotedStructGlobal = (PS){1, 2, 3}; // CHECK: define arm_aapcscc void @testPromotedStruct([[APS:.*]]* void testPromotedStruct(_Atomic(PS) *fp) { // CHECK: [[FP:%.*]] = alloca [[APS]]*, align 4 |

