diff options
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | test/CodeGenCXX/static-init.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index 2db54c2c8b..a96cb7ac8e 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -63,3 +63,19 @@ namespace test1 { // Make sure we emit the initializer correctly for the following: char base_req[] = { "foo" }; + +namespace union_static_local { + // CHECK: define internal void @_ZZN18union_static_local4testEvEN1c4mainEv + // CHECK: call void @_ZN18union_static_local1fEPNS_1xE(%"union.union_static_local::x"* bitcast ({ [2 x i8*] }* @_ZZN18union_static_local4testEvE3foo to %"union.union_static_local::x"*)) + union x { long double y; const char *x[2]; }; + void f(union x*); + void test() { + static union x foo = { .x = { "a", "b" } }; + struct c { + static void main() { + f(&foo); + } + }; + c::main(); + } +} |