diff options
Diffstat (limited to 'test/CodeGenCXX')
-rw-r--r-- | test/CodeGenCXX/const-init-cxx11.cpp | 11 | ||||
-rw-r--r-- | test/CodeGenCXX/member-init-anon-union.cpp | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp index 62a345a495..d1b91ba3f5 100644 --- a/test/CodeGenCXX/const-init-cxx11.cpp +++ b/test/CodeGenCXX/const-init-cxx11.cpp @@ -49,6 +49,17 @@ namespace StructUnion { // CHECK: @_ZN11StructUnion1fE = global {{.*}} { i32 5 } D f; + + union E { + int a; + void *b = &f; + }; + + // CHECK: @_ZN11StructUnion1gE = global {{.*}} @_ZN11StructUnion1fE + E g; + + // CHECK: @_ZN11StructUnion1hE = global {{.*}} @_ZN11StructUnion1fE + E h = E(); } namespace BaseClass { diff --git a/test/CodeGenCXX/member-init-anon-union.cpp b/test/CodeGenCXX/member-init-anon-union.cpp index 1ff7537387..4db31f0b83 100644 --- a/test/CodeGenCXX/member-init-anon-union.cpp +++ b/test/CodeGenCXX/member-init-anon-union.cpp @@ -2,8 +2,10 @@ // PR10531. +int make_a(); + static union { - int a = 42; + int a = make_a(); char *b; }; @@ -32,4 +34,4 @@ int g() { // CHECK: define {{.*}}@"[[CONSTRUCT_GLOBAL]]C2Ev" // CHECK-NOT: } -// CHECK: store i32 42 +// CHECK: call {{.*}}@_Z6make_a |