summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-05-15 17:36:21 +0000
committerAnders Carlsson <andersca@mac.com>2011-05-15 17:36:21 +0000
commitadf5dc340db3ea99de5fe3f6c42cfee1807d445e (patch)
treebd35c9590b148a18a0296776fbce9239eea54b4e /test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
parent714c992099b3b9442759f29038bb3f2c5a59a23d (diff)
Re-enable the fix for PR9181 now that all the edge cases are handled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/skip-vtable-pointer-initialization.cpp')
-rw-r--r--test/CodeGenCXX/skip-vtable-pointer-initialization.cpp83
1 files changed, 81 insertions, 2 deletions
diff --git a/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp b/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
index 3b70ec03a3..3520b912cf 100644
--- a/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
+++ b/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
-// XFAIL: *
namespace Test1 {
@@ -104,4 +103,84 @@ A::~A()
{
}
-} \ No newline at end of file
+}
+
+namespace Test6 {
+
+// Check that we do initialize the vtable pointer in A::~A(), since Field has a member
+// variable with a non-trivial destructor body.
+
+struct NonTrivialDestructorBody {
+ ~NonTrivialDestructorBody();
+};
+
+struct Field {
+ NonTrivialDestructorBody nonTrivialDestructorBody;
+};
+
+struct A {
+ virtual void f();
+ ~A();
+
+ Field field;
+};
+
+// CHECK: define void @_ZN5Test61AD2Ev
+// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test61AE, i64 0, i64 2), i8***
+A::~A()
+{
+}
+
+}
+
+namespace Test7 {
+
+// Check that we do initialize the vtable pointer in A::~A(), since Field has a base
+// class with a non-trivial destructor body.
+
+struct NonTrivialDestructorBody {
+ ~NonTrivialDestructorBody();
+};
+
+struct Field : NonTrivialDestructorBody { };
+
+struct A {
+ virtual void f();
+ ~A();
+
+ Field field;
+};
+
+// CHECK: define void @_ZN5Test71AD2Ev
+// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test71AE, i64 0, i64 2), i8***
+A::~A()
+{
+}
+
+}
+
+namespace Test8 {
+
+// Check that we do initialize the vtable pointer in A::~A(), since Field has a virtual base
+// class with a non-trivial destructor body.
+
+struct NonTrivialDestructorBody {
+ ~NonTrivialDestructorBody();
+};
+
+struct Field : virtual NonTrivialDestructorBody { };
+
+struct A {
+ virtual void f();
+ ~A();
+
+ Field field;
+};
+
+// CHECK: define void @_ZN5Test81AD2Ev
+// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test81AE, i64 0, i64 2), i8***
+A::~A()
+{
+}
+
+}