phunix/external/bsd/llvm/dist/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

36 lines
878 B
C++

// 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(); }