diff options
author | Anders Carlsson <andersca@mac.com> | 2011-05-16 04:08:36 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-05-16 04:08:36 +0000 |
commit | d6f1518cc905cffa641a0ced3be943664cb5e8e6 (patch) | |
tree | 8661cdd3bfe4ecba1a76ce8787881ee68f659fc6 /clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp | |
parent | 2050af838d717c1bc06fd1f340f8839c092e694a (diff) | |
download | bcm5719-llvm-d6f1518cc905cffa641a0ced3be943664cb5e8e6.tar.gz bcm5719-llvm-d6f1518cc905cffa641a0ced3be943664cb5e8e6.zip |
Fix another regression from the "skip vtable pointer initialization"
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.
llvm-svn: 131400
Diffstat (limited to 'clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp b/clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp index 3520b912cf9..84697be4a4c 100644 --- a/clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp +++ b/clang/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// See Test9 for test description. +// CHECK: @_ZTTN5Test91BE = linkonce_odr unnamed_addr constant namespace Test1 { // Check that we don't initialize the vtable pointer in A::~A(), since the destructor body is trivial. @@ -184,3 +186,15 @@ A::~A() } } + +namespace Test9 { + +// Check that we emit a VTT for B, even though we don't initialize the vtable pointer in the destructor. +struct A { virtual ~A () { } }; +struct B : virtual A {}; +struct C : virtual B { + virtual ~C(); +}; +C::~C() {} + +} |