diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-05 05:19:42 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-05 05:19:42 +0000 |
commit | ecac409cb0a26fb79ecb0ff15e2e446daa121371 (patch) | |
tree | 3d53d5b8d50e1321b3bf0823dc5607c89aeef0d8 /clang/test/CodeGenCXX/global-init.cpp | |
parent | f668204a6aec3b5a563dd074a88fdf3496a9e314 (diff) | |
download | bcm5719-llvm-ecac409cb0a26fb79ecb0ff15e2e446daa121371.tar.gz bcm5719-llvm-ecac409cb0a26fb79ecb0ff15e2e446daa121371.zip |
If a global initializer has a non-trivial destructor it can't be emitted as a constant (even if it has a trivial constructor).
llvm-svn: 95363
Diffstat (limited to 'clang/test/CodeGenCXX/global-init.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/global-init.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/global-init.cpp b/clang/test/CodeGenCXX/global-init.cpp index fd8c1597556..b60e056d708 100644 --- a/clang/test/CodeGenCXX/global-init.cpp +++ b/clang/test/CodeGenCXX/global-init.cpp @@ -9,6 +9,8 @@ struct B { B(); ~B(); }; struct C { void *field; }; +struct D { ~D(); }; + // CHECK: @c = global %struct.C zeroinitializer, align 8 // CHECK: call void @_ZN1AC1Ev(%struct.A* @a) @@ -23,4 +25,7 @@ B b; // CHECK-NOT: call void @_ZN1CC1Ev(%struct.C* @c) C c; +// CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1DD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @d, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*)) +D d; + // CHECK: define internal void @__cxx_global_initialization() { |