aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-11 18:20:28 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-11 18:20:28 +0000
commit848fa64143fbe5ae62a601ad61277f741e54dfab (patch)
treebc0dedaa6e2d1dba6c8d194763c36182530a83a9 /test/CodeGenCXX/vtable-layout.cpp
parentb203c9ee39be3170a7d545db057de8ea62959259 (diff)
More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
index beb82ef905..dd9109e158 100644
--- a/test/CodeGenCXX/vtable-layout.cpp
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -5,12 +5,36 @@ namespace Test1 {
// CHECK-NEXT: 0 | offset_to_top (0)
// CHECK-NEXT: 1 | Test1::A RTTI
// CHECK-NEXT: -- (Test1::A, 0) vtable address --
-// CHECK-NEXT: 2 | Test1::A::f
+// CHECK-NEXT: 2 | void Test1::A::f()
struct A {
virtual void f();
};
void A::f() { }
-
}
+namespace Test2 {
+
+// This is a smoke test of the vtable dumper.
+// CHECK: Vtable for 'Test2::A' (8 entries).
+// CHECK-NEXT: 0 | offset_to_top (0)
+// CHECK-NEXT: 1 | Test2::A RTTI
+// CHECK-NEXT: -- (Test2::A, 0) vtable address --
+// CHECK-NEXT: 2 | void Test2::A::f()
+// CHECK-NEXT: 3 | void Test2::A::f() const
+// CHECK-NEXT: 4 | Test2::A *Test2::A::g(int)
+// CHECK-NEXT: 5 | Test2::A::~A() [complete]
+// CHECK-NEXT: 6 | Test2::A::~A() [deleting]
+// CHECK-NEXT: 7 | void Test2::A::h()
+struct A {
+ virtual void f();
+ virtual void f() const;
+
+ virtual A* g(int a);
+ virtual ~A();
+ virtual void h();
+};
+
+void A::f() { }
+
+}