2016-09-01 04:35:01 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited -gcodeview -emit-llvm -o - | FileCheck %s
|
|
|
|
|
|
|
|
// Tests virtual bases in the MS ABI.
|
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
// CHECK: ![[NoPrimaryBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "NoPrimaryBase",
|
|
|
|
// CHECK-SAME: elements: ![[elements:[0-9]+]]
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
// CHECK: ![[elements]] = !{![[NoPrimaryBase_base:[0-9]+]]}
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
// CHECK: ![[NoPrimaryBase_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[NoPrimaryBase]],
|
2018-05-15 05:21:22 +08:00
|
|
|
// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 0)
|
2016-09-13 09:13:19 +08:00
|
|
|
|
|
|
|
// CHECK: ![[HasVirtualMethod]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasVirtualMethod"
|
|
|
|
|
|
|
|
// CHECK: ![[HasPrimaryBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasPrimaryBase",
|
|
|
|
// CHECK-SAME: elements: ![[elements:[0-9]+]]
|
|
|
|
|
|
|
|
// CHECK: ![[elements]] = !{![[SecondaryVTable_base:[0-9]+]], ![[HasVirtualMethod_base:[0-9]+]], ![[vshape:[0-9]+]]}
|
|
|
|
|
|
|
|
// CHECK: ![[SecondaryVTable_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]],
|
2018-05-15 05:21:22 +08:00
|
|
|
// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 4)
|
2016-09-13 09:13:19 +08:00
|
|
|
|
|
|
|
// CHECK: ![[SecondaryVTable]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SecondaryVTable"
|
|
|
|
|
2018-05-15 05:21:22 +08:00
|
|
|
// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]], extraData: i32 0)
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-10-26 06:19:32 +08:00
|
|
|
// CHECK: ![[HasIndirectVirtualBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasIndirectVirtualBase"
|
|
|
|
// CHECK-SAME: elements: ![[elements:[0-9]+]]
|
|
|
|
|
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasIndirectVirtualBase]], baseType: ![[HasPrimaryBase]]
|
|
|
|
// CHECK-NOT: DIFlagIndirectVirtualBase
|
|
|
|
// CHECK-SAME: )
|
|
|
|
|
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasIndirectVirtualBase]], baseType: ![[SecondaryVTable]]
|
|
|
|
// CHECK-SAME: flags:
|
|
|
|
// CHECK-SAME: DIFlagIndirectVirtualBase
|
|
|
|
|
2016-09-01 04:35:01 +08:00
|
|
|
// CHECK: ![[DynamicNoVFPtr:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "DynamicNoVFPtr",
|
|
|
|
// CHECK-SAME: elements: ![[elements:[0-9]+]]
|
|
|
|
|
|
|
|
// CHECK: ![[elements]] = !{![[POD_base:[0-9]+]]}
|
|
|
|
|
|
|
|
// CHECK: ![[POD_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[DynamicNoVFPtr]],
|
2018-05-15 05:21:22 +08:00
|
|
|
// CHECK-SAME: baseType: ![[POD:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 0)
|
2016-09-01 04:35:01 +08:00
|
|
|
|
|
|
|
// CHECK: ![[POD]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "POD"
|
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
struct POD { int pod; };
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
struct DynamicNoVFPtr : virtual POD { };
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
DynamicNoVFPtr dynamic_no_vfptr;
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
struct HasVirtualMethod { virtual void f(); };
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
struct NoPrimaryBase : virtual HasVirtualMethod { };
|
2016-09-01 04:35:01 +08:00
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
NoPrimaryBase no_primary_base;
|
2016-09-01 04:35:01 +08:00
|
|
|
|
|
|
|
struct SecondaryVTable { virtual void g(); };
|
|
|
|
|
|
|
|
struct HasPrimaryBase : virtual SecondaryVTable, HasVirtualMethod { };
|
|
|
|
|
|
|
|
HasPrimaryBase has_primary_base;
|
|
|
|
|
2016-10-26 06:19:32 +08:00
|
|
|
struct HasIndirectVirtualBase : public HasPrimaryBase {};
|
|
|
|
|
|
|
|
HasIndirectVirtualBase has_indirect_virtual_base;
|