aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-11 08:02:13 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-11 08:02:13 +0000
commit824d7ea07a4e9208925daa6ae9289fb2b39bce9f (patch)
tree444bccfaa07f36ab4acb18db0aa50de494b0d6a8 /test/CodeGenCXX/vtable-layout.cpp
parent020a095de30ede5b1e3fc65dae501f225a1c89d3 (diff)
Check in the beginnings of my new vtable layout builder idea.
Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code. I've also added a very simple new vtable layout test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
new file mode 100644
index 0000000000..6bfa025bea
--- /dev/null
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s
+namespace Test1 {
+
+// CHECK: Vtable for 'Test1::A' (3 entries).
+// CHECK-NEXT: 0 | offset_to_top (0)
+// CHECK-NEXT: 1 | Test1::A RTTI
+// CHECK-NEXT: 2 | Test1::A::f
+struct A {
+ virtual void f();
+};
+
+void A::f() { }
+
+}
+