1 // RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -o %t.ll -fdump-vtable-layouts >%t
2 // RUN: FileCheck %s < %t
3 // RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
4
5 struct A {
6 virtual void f();
7 };
8
9 struct B {
10 virtual void g() = 0;
11 virtual void h();
12 };
13
14 struct C : A, B {
15 // CHECK-LABEL: VFTable for 'A' in 'C' (1 entry)
16 // CHECK-NEXT: 0 | void A::f()
17
18 // CHECK-LABEL: VFTable for 'B' in 'C' (2 entries)
19 // CHECK-NEXT: 0 | void C::g()
20 // CHECK-NEXT: 1 | void B::h()
21
22 // CHECK-LABEL: VFTable indices for 'C' (1 entry).
23 // CHECK-NEXT: via vfptr at offset 4
24 // CHECK-NEXT: 0 | void C::g()
25
26 // MANGLING-DAG: @"\01??_7C@@6BA@@@"
27 // MANGLING-DAG: @"\01??_7C@@6BB@@@"
28
29 // Overrides only the right child's method (B::g),
30 // needs this adjustment but not thunks.
31 virtual void g();
32 };
33
34 C c;
build_vftable(C * obj)35 void build_vftable(C *obj) { obj->g(); }
36