diff options
author | Timur Iskhodzhanov <timurrrr@google.com> | 2013-10-16 18:24:06 +0000 |
---|---|---|
committer | Timur Iskhodzhanov <timurrrr@google.com> | 2013-10-16 18:24:06 +0000 |
commit | 82552742a1002cf1408d6f371efc9cc6a9f2d7cc (patch) | |
tree | bb2d5c294f3f8bcaa6cb3f6bc3550a24f6f0e61b /test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp | |
parent | 289a0d810fb35c960f33c33ff8b7185c11d04d5f (diff) |
[-cxx-abi microsoft] Fix this argument/parameter offsets for virtual destructors in the presence of virtual bases
Reviewed at http://llvm-reviews.chandlerc.com/D1939
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp')
-rw-r--r-- | test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp index a7ddd37d6f..a1fe5533b5 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp @@ -15,6 +15,10 @@ // RUN: FileCheck --check-prefix=TEST9-W %s < %t // RUN: FileCheck --check-prefix=TEST9-T %s < %t // RUN: FileCheck --check-prefix=TEST10 %s < %t +// RUN: FileCheck --check-prefix=VDTORS-Y %s < %t +// RUN: FileCheck --check-prefix=VDTORS-U %s < %t +// RUN: FileCheck --check-prefix=VDTORS-V %s < %t +// RUN: FileCheck --check-prefix=VDTORS-P %s < %t // RUN: FileCheck --check-prefix=RET-W %s < %t // RUN: FileCheck --check-prefix=RET-T %s < %t @@ -408,6 +412,87 @@ void X::f() {} X x; } +namespace vdtors { +struct X { + virtual ~X(); + virtual void zzz(); +}; + +struct Y : virtual X { + // VDTORS-Y: VFTable for 'vdtors::X' in 'vdtors::Y' (2 entries). + // VDTORS-Y-NEXT: 0 | vdtors::Y::~Y() [scalar deleting] + // VDTORS-Y-NEXT: 1 | void vdtors::X::zzz() + + // VDTORS-Y-NOT: Thunks for 'vdtors::Y::~Y()' + virtual ~Y(); +}; + +Y y; + +struct Z { + virtual void z(); +}; + +struct W : Z, X { + // Implicit virtual dtor. +}; + +struct U : virtual W { + // VDTORS-U: VFTable for 'vdtors::Z' in 'vdtors::W' in 'vdtors::U' (1 entries). + // VDTORS-U-NEXT: 0 | void vdtors::Z::z() + + // VDTORS-U: VFTable for 'vdtors::X' in 'vdtors::W' in 'vdtors::U' (2 entries). + // VDTORS-U-NEXT: 0 | vdtors::U::~U() [scalar deleting] + // VDTORS-U-NEXT: [this adjustment: -4 non-virtual] + // VDTORS-U-NEXT: 1 | void vdtors::X::zzz() + + // VDTORS-U: Thunks for 'vdtors::W::~W()' (1 entry). + // VDTORS-U-NEXT: 0 | this adjustment: -4 non-virtual + + // VDTORS-U: VFTable indices for 'vdtors::U' (1 entries). + // VDTORS-U-NEXT: -- accessible via vbtable index 1, vfptr at offset 4 -- + // VDTORS-U-NEXT: 0 | vdtors::U::~U() [scalar deleting] + virtual ~U(); +}; + +U u; + +struct V : virtual W { + // VDTORS-V: VFTable for 'vdtors::Z' in 'vdtors::W' in 'vdtors::V' (1 entries). + // VDTORS-V-NEXT: 0 | void vdtors::Z::z() + + // VDTORS-V: VFTable for 'vdtors::X' in 'vdtors::W' in 'vdtors::V' (2 entries). + // VDTORS-V-NEXT: 0 | vdtors::V::~V() [scalar deleting] + // VDTORS-V-NEXT: [this adjustment: -4 non-virtual] + // VDTORS-V-NEXT: 1 | void vdtors::X::zzz() + + // VDTORS-V: Thunks for 'vdtors::W::~W()' (1 entry). + // VDTORS-V-NEXT: 0 | this adjustment: -4 non-virtual + + // VDTORS-V: VFTable indices for 'vdtors::V' (1 entries). + // VDTORS-V-NEXT: -- accessible via vbtable index 1, vfptr at offset 4 -- + // VDTORS-V-NEXT: 0 | vdtors::V::~V() [scalar deleting] +}; + +V v; + +struct T : virtual X { + virtual ~T(); +}; + +struct P : T, Y { + // VDTORS-P: VFTable for 'vdtors::X' in 'vdtors::T' in 'vdtors::P' (2 entries). + // VDTORS-P-NEXT: 0 | vdtors::P::~P() [scalar deleting] + // VDTORS-P-NEXT: 1 | void vdtors::X::zzz() + + // VDTORS-P-NOT: Thunks for 'vdtors::P::~P()' + virtual ~P(); +}; + +P p; + +} + namespace return_adjustment { struct X : virtual A { |