aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-05-16 04:08:36 +0000
committerAnders Carlsson <andersca@mac.com>2011-05-16 04:08:36 +0000
commite3d6cf2149beb1c215ea6e87023c27b4f37712ad (patch)
tree8dac9c1cbee436b7aff5d567a3aae0d32869d6e3 /test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
parentcb63e07c588dc7030f3f41812dea73f3571e449a (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/skip-vtable-pointer-initialization.cpp')
-rw-r--r--test/CodeGenCXX/skip-vtable-pointer-initialization.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp b/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
index 3520b912cf..84697be4a4 100644
--- a/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
+++ b/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() {}
+
+}