summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-04-21 20:23:34 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-04-21 20:23:34 +0000
commitcc623a02acc749d3125d3e9b707fcdcb118c7933 (patch)
tree3a18c316554cfffe532897be9602d0ca3720b976 /test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp
parent46ddd12e6bc915051322ab6ddd6101216fd21086 (diff)
Split out the rest of MS ABI multiple inheritance tests
Intentionally duplicate base class definitions per test, so it's easier to copy tests while debugging failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp')
-rw-r--r--test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp
new file mode 100644
index 0000000000..76182a2e33
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -o %t.ll -fdump-vtable-layouts >%t
+// RUN: FileCheck %s < %t
+// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
+
+struct A {
+ virtual void f();
+};
+
+struct B {
+ virtual void g() = 0;
+ virtual void h();
+};
+
+struct C : A, B {
+ // CHECK-LABEL: VFTable for 'A' in 'C' (1 entry)
+ // CHECK-NEXT: 0 | void A::f()
+
+ // CHECK-LABEL: VFTable for 'B' in 'C' (2 entries)
+ // CHECK-NEXT: 0 | void C::g()
+ // CHECK-NEXT: 1 | void B::h()
+
+ // CHECK-LABEL: VFTable indices for 'C' (1 entry).
+ // CHECK-NEXT: via vfptr at offset 4
+ // CHECK-NEXT: 0 | void C::g()
+
+ // MANGLING-DAG: @"\01??_7C@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7C@@6BB@@@"
+
+ // Overrides only the right child's method (B::g),
+ // needs this adjustment but not thunks.
+ virtual void g();
+};
+
+C c;
+void build_vftable(C *obj) { obj->g(); }