r204465 - Simplify test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp by forcing VFTableBuilder invocation with virtual function calls
Timur Iskhodzhanov
timurrrr at google.com
Fri Mar 21 06:27:08 PDT 2014
Author: timurrrr
Date: Fri Mar 21 08:27:08 2014
New Revision: 204465
URL: http://llvm.org/viewvc/llvm-project?rev=204465&view=rev
Log:
Simplify test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp by forcing VFTableBuilder invocation with virtual function calls
Previously the vftables were built at the end of the TU in a reverse-to-random order
Modified:
cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp?rev=204465&r1=204464&r2=204465&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp Fri Mar 21 08:27:08 2014
@@ -1,15 +1,5 @@
// RUN: %clang_cc1 -fno-rtti -emit-llvm -fdump-vtable-layouts %s -o %t.ll -triple=i386-pc-win32 > %t
-// RUN: FileCheck --check-prefix=VTABLE-SIMPLE-A %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-SIMPLE-B %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-SIMPLE-C %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-A %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-B %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-C %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-E %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-F %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-G %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-H %s < %t
-// RUN: FileCheck --check-prefix=VTABLE-PR17738-A %s < %t
+// RUN: FileCheck %s < %t
// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
// For now, just make sure x86_64 doesn't crash.
@@ -64,17 +54,17 @@ namespace simple {
// jmp Method at Class
struct A : virtual V1 {
- // VTABLE-SIMPLE-A: VFTable for 'V1' in 'simple::A' (2 entries).
- // VTABLE-SIMPLE-A-NEXT: 0 | void simple::A::f()
- // VTABLE-SIMPLE-A-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
- // VTABLE-SIMPLE-A-NEXT: 1 | simple::A::~A() [scalar deleting]
- // VTABLE-SIMPLE-A-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+ // CHECK-LABEL: VFTable for 'V1' in 'simple::A' (2 entries).
+ // CHECK-NEXT: 0 | void simple::A::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+ // CHECK-NEXT: 1 | simple::A::~A() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
- // VTABLE-SIMPLE-A: Thunks for 'simple::A::~A()' (1 entry).
- // VTABLE-SIMPLE-A-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
+ // CHECK-LABEL: Thunks for 'simple::A::~A()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
- // VTABLE-SIMPLE-A: Thunks for 'void simple::A::f()' (1 entry).
- // VTABLE-SIMPLE-A-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
+ // CHECK-LABEL: Thunks for 'void simple::A::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
virtual void f();
// MANGLING-DAG: @"\01?f at A@simple@@$4PPPPPPPM at A@AEXXZ"
@@ -84,27 +74,28 @@ struct A : virtual V1 {
};
A a;
+void use(A *obj) { obj->f(); }
struct B : virtual V3 {
- // VTABLE-SIMPLE-B: VFTable for 'Z' in 'V3' in 'simple::B' (2 entries).
- // VTABLE-SIMPLE-B-NEXT: 0 | void Z::g()
- // VTABLE-SIMPLE-B-NEXT: 1 | simple::B::~B() [scalar deleting]
- // VTABLE-SIMPLE-B-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
-
- // VTABLE-SIMPLE-B: Thunks for 'simple::B::~B()' (1 entry).
- // VTABLE-SIMPLE-B-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
-
- // VTABLE-SIMPLE-B: VFTable for 'V2' in 'V3' in 'simple::B' (2 entries).
- // VTABLE-SIMPLE-B-NEXT: 0 | void simple::B::f()
- // VTABLE-SIMPLE-B-NEXT: [this adjustment: vtordisp at -12, 0 non-virtual]
- // VTABLE-SIMPLE-B-NEXT: 1 | simple::B::~B() [scalar deleting]
- // VTABLE-SIMPLE-B-NEXT: [this adjustment: vtordisp at -12, -8 non-virtual]
+ // CHECK-LABEL: VFTable for 'Z' in 'V3' in 'simple::B' (2 entries).
+ // CHECK-NEXT: 0 | void Z::g()
+ // CHECK-NEXT: 1 | simple::B::~B() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'simple::B::~B()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // CHECK-LABEL: VFTable for 'V2' in 'V3' in 'simple::B' (2 entries).
+ // CHECK-NEXT: 0 | void simple::B::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -12, 0 non-virtual]
+ // CHECK-NEXT: 1 | simple::B::~B() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -12, -8 non-virtual]
- // VTABLE-SIMPLE-B: Thunks for 'simple::B::~B()' (1 entry).
- // VTABLE-SIMPLE-B-NEXT: 0 | [this adjustment: vtordisp at -12, -8 non-virtual]
+ // CHECK-LABEL: Thunks for 'simple::B::~B()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -12, -8 non-virtual]
- // VTABLE-SIMPLE-B: Thunks for 'void simple::B::f()' (1 entry).
- // VTABLE-SIMPLE-B-NEXT: 0 | [this adjustment: vtordisp at -12, 0 non-virtual]
+ // CHECK-LABEL: Thunks for 'void simple::B::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -12, 0 non-virtual]
// FIXME: The vtordisp thunk should only get emitted for a constructor
// if "this" leaves scope.
@@ -119,39 +110,40 @@ struct B : virtual V3 {
};
B b;
+void use(B *obj) { obj->f(); }
struct C : virtual V4 {
- // VTABLE-SIMPLE-C: VFTable for 'Z' in 'V4' in 'simple::C' (2 entries).
- // VTABLE-SIMPLE-C-NEXT: 0 | void Z::g()
- // VTABLE-SIMPLE-C-NEXT: 1 | simple::C::~C() [scalar deleting]
- // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
-
- // VTABLE-SIMPLE-C: Thunks for 'simple::C::~C()' (1 entry).
- // VTABLE-SIMPLE-C-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
-
- // VTABLE-SIMPLE-C: VFTable for 'V1' in 'V4' in 'simple::C' (2 entries).
- // VTABLE-SIMPLE-C-NEXT: 0 | void simple::C::f()
- // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -12, 0 non-virtual]
- // VTABLE-SIMPLE-C-NEXT: 1 | simple::C::~C() [scalar deleting]
- // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -12, -8 non-virtual]
-
- // VTABLE-SIMPLE-C: Thunks for 'simple::C::~C()' (1 entry).
- // VTABLE-SIMPLE-C-NEXT: 0 | [this adjustment: vtordisp at -12, -8 non-virtual]
-
- // VTABLE-SIMPLE-C: Thunks for 'void simple::C::f()' (1 entry).
- // VTABLE-SIMPLE-C-NEXT: 0 | [this adjustment: vtordisp at -12, 0 non-virtual]
-
- // VTABLE-SIMPLE-C: VFTable for 'V2' in 'V4' in 'simple::C' (2 entries).
- // VTABLE-SIMPLE-C-NEXT: 0 | void simple::C::f()
- // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -16, -4 non-virtual]
- // VTABLE-SIMPLE-C-NEXT: 1 | simple::C::~C() [scalar deleting]
- // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -16, -12 non-virtual]
+ // CHECK-LABEL: VFTable for 'Z' in 'V4' in 'simple::C' (2 entries).
+ // CHECK-NEXT: 0 | void Z::g()
+ // CHECK-NEXT: 1 | simple::C::~C() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'simple::C::~C()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // CHECK-LABEL: VFTable for 'V1' in 'V4' in 'simple::C' (2 entries).
+ // CHECK-NEXT: 0 | void simple::C::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -12, 0 non-virtual]
+ // CHECK-NEXT: 1 | simple::C::~C() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -12, -8 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'simple::C::~C()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -12, -8 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void simple::C::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -12, 0 non-virtual]
+
+ // CHECK-LABEL: VFTable for 'V2' in 'V4' in 'simple::C' (2 entries).
+ // CHECK-NEXT: 0 | void simple::C::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -16, -4 non-virtual]
+ // CHECK-NEXT: 1 | simple::C::~C() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -16, -12 non-virtual]
- // VTABLE-SIMPLE-C: Thunks for 'simple::C::~C()' (1 entry).
- // VTABLE-SIMPLE-C-NEXT: 0 | [this adjustment: vtordisp at -16, -12 non-virtual]
+ // CHECK-LABEL: Thunks for 'simple::C::~C()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -16, -12 non-virtual]
- // VTABLE-SIMPLE-C: Thunks for 'void simple::C::f()' (1 entry).
- // VTABLE-SIMPLE-C-NEXT: 0 | [this adjustment: vtordisp at -16, -4 non-virtual]
+ // CHECK-LABEL: Thunks for 'void simple::C::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -16, -4 non-virtual]
int x;
virtual void f();
@@ -164,6 +156,7 @@ struct C : virtual V4 {
};
C c;
+void use(C *obj) { obj->f(); }
}
namespace extended {
@@ -182,16 +175,16 @@ namespace extended {
// jmp Method at Class
struct A : virtual simple::A {
- // VTABLE-EXTENDED-A: VFTable for 'V1' in 'simple::A' in 'extended::A' (2 entries).
- // VTABLE-EXTENDED-A-NEXT: 0 | void simple::A::f()
- // VTABLE-EXTENDED-A-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-A-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
- // VTABLE-EXTENDED-A-NEXT: 1 | extended::A::~A() [scalar deleting]
- // VTABLE-EXTENDED-A-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
-
- // VTABLE-EXTENDED-A: Thunks for 'void simple::A::f()' (1 entry).
- // VTABLE-EXTENDED-A-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-A-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-LABEL: VFTable for 'V1' in 'simple::A' in 'extended::A' (2 entries).
+ // CHECK-NEXT: 0 | void simple::A::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-NEXT: 1 | extended::A::~A() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void simple::A::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
// `vtordispex{8,8,4294967292,8}'
// MANGLING-DAG: @"\01?f at A@simple@@$R477PPPPPPPM at 7AEXXZ"
@@ -202,36 +195,38 @@ struct A : virtual simple::A {
};
A a;
+void use(A *obj) { delete obj; }
struct B : virtual simple::A {
// This class has an implicit dtor. Vdtors don't require vtordispex thunks
// as the most derived class always has an implicit dtor,
// which is a final overrider.
- // VTABLE-EXTENDED-B: VFTable for 'V1' in 'simple::A' in 'extended::B' (2 entries).
+ // CHECK-LABEL: VFTable for 'V1' in 'simple::A' in 'extended::B' (2 entries).
// ...
- // VTABLE-EXTENDED-B: 1 | extended::B::~B() [scalar deleting]
- // VTABLE-EXTENDED-B-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+ // CHECK: 1 | extended::B::~B() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
- // VTABLE-EXTENDED-B: Thunks for 'void simple::A::f()' (1 entry).
- // VTABLE-EXTENDED-B-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-B-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-LABEL: Thunks for 'void simple::A::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
// vtordisp{4294967292,0}
// MANGLING-DAG: @"\01??_EB at extended@@$4PPPPPPPM at A@AEPAXI at Z"
};
B b;
+void use(B *obj) { delete obj; }
struct C : virtual simple::A {
- // VTABLE-EXTENDED-C: VFTable for 'V1' in 'simple::A' in 'extended::C' (2 entries).
- // VTABLE-EXTENDED-C-NEXT: 0 | void simple::A::f()
- // VTABLE-EXTENDED-C-NEXT: [this adjustment: vtordisp at -4, vbptr at 12 to the left,
- // VTABLE-EXTENDED-C-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
-
- // VTABLE-EXTENDED-C: Thunks for 'void simple::A::f()' (1 entry).
- // VTABLE-EXTENDED-C-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 12 to the left,
- // VTABLE-EXTENDED-C-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-LABEL: VFTable for 'V1' in 'simple::A' in 'extended::C' (2 entries).
+ // CHECK-NEXT: 0 | void simple::A::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, vbptr at 12 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void simple::A::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 12 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
// `vtordispex{12,8,4294967292,8}'
// MANGLING-DAG: @"\01?f at A@simple@@$R4M at 7PPPPPPPM@7AEXXZ"
@@ -241,6 +236,7 @@ struct C : virtual simple::A {
};
C c;
+void use(C *obj) { delete obj; }
struct D : virtual V2 {
virtual void f();
@@ -249,14 +245,14 @@ struct D : virtual V2 {
};
struct E : virtual D {
- // VTABLE-EXTENDED-E: VFTable for 'V2' in 'extended::D' in 'extended::E' (2 entries).
- // VTABLE-EXTENDED-E-NEXT: 0 | void extended::D::f()
- // VTABLE-EXTENDED-E-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-E-NEXT: vboffset at 8 in the vbtable, 12 non-virtual]
-
- // VTABLE-EXTENDED-E: Thunks for 'void extended::D::f()' (1 entry).
- // VTABLE-EXTENDED-E-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-E-NEXT: vboffset at 8 in the vbtable, 12 non-virtual]
+ // CHECK-LABEL: VFTable for 'V2' in 'extended::D' in 'extended::E' (2 entries).
+ // CHECK-NEXT: 0 | void extended::D::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 12 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void extended::D::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 12 non-virtual]
// `vtordispex{8,8,4294967292,12}'
// MANGLING-DAG: @"\01?f at D@extended@@$R477PPPPPPPM at M@AEXXZ"
@@ -266,16 +262,17 @@ struct E : virtual D {
};
E e;
+void use(E *obj) { delete obj; }
struct F : virtual Z, virtual D {
- // VTABLE-EXTENDED-F: VFTable for 'V2' in 'extended::D' in 'extended::F' (2 entries).
- // VTABLE-EXTENDED-F-NEXT: 0 | void extended::D::f()
- // VTABLE-EXTENDED-F-NEXT: [this adjustment: vtordisp at -4, vbptr at 20 to the left,
- // VTABLE-EXTENDED-F-NEXT: vboffset at 12 in the vbtable, 12 non-virtual]
-
- // VTABLE-EXTENDED-F: Thunks for 'void extended::D::f()' (1 entry).
- // VTABLE-EXTENDED-F-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 20 to the left,
- // VTABLE-EXTENDED-F-NEXT: vboffset at 12 in the vbtable, 12 non-virtual]
+ // CHECK-LABEL: VFTable for 'V2' in 'extended::D' in 'extended::F' (2 entries).
+ // CHECK-NEXT: 0 | void extended::D::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, vbptr at 20 to the left,
+ // CHECK-NEXT: vboffset at 12 in the vbtable, 12 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void extended::D::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 20 to the left,
+ // CHECK-NEXT: vboffset at 12 in the vbtable, 12 non-virtual]
// `vtordispex{20,12,4294967292,12}'
// MANGLING-DAG: @"\01?f at D@extended@@$R4BE at M@PPPPPPPM at M@AEXXZ"
@@ -285,21 +282,22 @@ struct F : virtual Z, virtual D {
};
F f;
+void use(F *obj) { delete obj; }
struct G : virtual simple::A {
- // VTABLE-EXTENDED-G: VFTable for 'extended::G' (1 entry).
- // VTABLE-EXTENDED-G-NEXT: 0 | void extended::G::g()
+ // CHECK-LABEL: VFTable for 'extended::G' (1 entry).
+ // CHECK-NEXT: 0 | void extended::G::g()
- // VTABLE-EXTENDED-G: VFTable for 'V1' in 'simple::A' in 'extended::G' (2 entries).
- // VTABLE-EXTENDED-G-NEXT: 0 | void simple::A::f()
- // VTABLE-EXTENDED-G-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-G-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
- // VTABLE-EXTENDED-G-NEXT: 1 | extended::G::~G() [scalar deleting]
- // VTABLE-EXTENDED-G-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
-
- // VTABLE-EXTENDED-G: Thunks for 'void simple::A::f()' (1 entry).
- // VTABLE-EXTENDED-G-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-G-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-LABEL: VFTable for 'V1' in 'simple::A' in 'extended::G' (2 entries).
+ // CHECK-NEXT: 0 | void simple::A::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-NEXT: 1 | extended::G::~G() [scalar deleting]
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void simple::A::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
// Emits a G's own vfptr, thus moving the vbptr in the layout.
virtual void g();
@@ -310,26 +308,28 @@ struct G : virtual simple::A {
};
G g;
+void use(G *obj) { obj->g(); }
struct H : Z, A {
- // VTABLE-EXTENDED-H: VFTable for 'Z' in 'extended::H' (2 entries).
- // VTABLE-EXTENDED-H-NEXT: 0 | void Z::g()
- // VTABLE-EXTENDED-H-NEXT: 1 | extended::H::~H() [scalar deleting]
-
- // VTABLE-EXTENDED-H: VFTable for 'V1' in 'simple::A' in 'extended::A' in 'extended::H' (2 entries).
- // VTABLE-EXTENDED-H-NEXT: 0 | void simple::A::f()
- // VTABLE-EXTENDED-H-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-H-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
-
- // VTABLE-EXTENDED-H: Thunks for 'void simple::A::f()' (1 entry).
- // VTABLE-EXTENDED-H-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
- // VTABLE-EXTENDED-H-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // CHECK-LABEL: VFTable for 'Z' in 'extended::H' (2 entries).
+ // CHECK-NEXT: 0 | void Z::g()
+ // CHECK-NEXT: 1 | extended::H::~H() [scalar deleting]
+
+ // CHECK-LABEL: VFTable for 'V1' in 'simple::A' in 'extended::A' in 'extended::H' (2 entries).
+ // CHECK-NEXT: 0 | void simple::A::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void simple::A::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
// MANGLING-DAG: @"\01?f at A@simple@@$R477PPPPPPPM at 7AEXXZ"
// MANGLING-DAG: @"\01??_EH at extended@@$4PPPPPPPM at BA@AEPAXI at Z"
};
H h;
+void use(H *obj) { delete obj; }
}
namespace pr17738 {
@@ -337,14 +337,14 @@ namespace pr17738 {
// Just do the right thing.
struct A : virtual simple::B {
- // VTABLE-PR17738-A: VFTable for 'V2' in 'V3' in 'simple::B' in 'pr17738::A' (2 entries).
- // VTABLE-PR17738-A-NEXT: 0 | void simple::B::f()
- // VTABLE-PR17738-A-NEXT: [this adjustment: vtordisp at -12, vbptr at 20 to the left,
- // VTABLE-PR17738-A-NEXT: vboffset at 8 in the vbtable, 16 non-virtual]
-
- // VTABLE-PR17738-A: Thunks for 'void simple::B::f()' (1 entry).
- // VTABLE-PR17738-A-NEXT: 0 | [this adjustment: vtordisp at -12, vbptr at 20 to the left,
- // VTABLE-PR17738-A-NEXT: vboffset at 8 in the vbtable, 16 non-virtual]
+ // CHECK-LABEL: VFTable for 'V2' in 'V3' in 'simple::B' in 'pr17738::A' (2 entries).
+ // CHECK-NEXT: 0 | void simple::B::f()
+ // CHECK-NEXT: [this adjustment: vtordisp at -12, vbptr at 20 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 16 non-virtual]
+
+ // CHECK-LABEL: Thunks for 'void simple::B::f()' (1 entry).
+ // CHECK-NEXT: 0 | [this adjustment: vtordisp at -12, vbptr at 20 to the left,
+ // CHECK-NEXT: vboffset at 8 in the vbtable, 16 non-virtual]
// MANGLING-DAG: @"\01?f at B@simple@@$R4BE at 7PPPPPPPE@BA at AEXXZ"
int a;
@@ -352,6 +352,7 @@ struct A : virtual simple::B {
};
A a;
+void use(A *obj) { delete obj; }
}
namespace access {
More information about the cfe-commits
mailing list