aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-13 21:16:54 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-13 21:16:54 +0000
commit1d05be51b09ae1ce65b1ecd6220bade12908586d (patch)
tree2a4e0444a4a5338810a98d84382e243678a5de22 /test/CodeGenCXX/vtable-layout.cpp
parent60db0ee2c1d91ea86b04b5e448810ba418058180 (diff)
Don't make return adjustments for pure virtual member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
index 19ce8da4cf..622983f7c8 100644
--- a/test/CodeGenCXX/vtable-layout.cpp
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -182,6 +182,23 @@ struct E : A {
};
V3 *E::f() { return 0;}
+// Test that a pure virtual member doesn't get a thunk.
+
+// CHECK: Vtable for 'Test4::F' (5 entries).
+// CHECK-NEXT: 0 | offset_to_top (0)
+// CHECK-NEXT: 1 | Test4::F RTTI
+// CHECK-NEXT: -- (Test4::A, 0) vtable address --
+// CHECK-NEXT: -- (Test4::F, 0) vtable address --
+// CHECK-NEXT: 2 | Test4::R3 *Test4::F::f() [pure]
+// CHECK-NEXT: 3 | void Test4::F::g()
+// CHECK-NEXT: 4 | Test4::R3 *Test4::F::f() [pure]
+struct F : A {
+ virtual void g();
+ virtual R3 *f() = 0;
+};
+
+void F::g() { }
+
}
// For now, just verify this doesn't crash.