diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-03-09 03:27:46 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-03-09 03:27:46 +0000 |
commit | 1c8d2ca82996a1e6c6f3e827fa44fb2acde97c89 (patch) | |
tree | 28cdccddba6938f96136c17aa11a3884c1b793b9 /clang/test/CodeGenCXX/static-init.cpp | |
parent | 9d60f6076032f2947055f9c2791afedc29d75299 (diff) | |
download | llvm-1c8d2ca82996a1e6c6f3e827fa44fb2acde97c89.zip llvm-1c8d2ca82996a1e6c6f3e827fa44fb2acde97c89.tar.gz llvm-1c8d2ca82996a1e6c6f3e827fa44fb2acde97c89.tar.bz2 |
Make sure we update the static local decl address map when we are forced to rebuild a global because of the initializer. <rdar://problem/10957867>.
llvm-svn: 152372
Diffstat (limited to 'clang/test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/static-init.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/static-init.cpp b/clang/test/CodeGenCXX/static-init.cpp index 2db54c2..a96cb7a 100644 --- a/clang/test/CodeGenCXX/static-init.cpp +++ b/clang/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(); + } +} |