blob: dfcd06c636703dec6d56f09105178a535b749560 [file] [log] [blame]
Adrian McCarthyab1e7862016-07-21 18:43:20 +00001// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited -gcodeview -emit-llvm -o - | FileCheck %s
Reid Kleckner75557712018-11-16 18:47:41 +00002// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited -gcodeview -gcodeview-ghash -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,GHASH
Reid Kleckner45fe3762016-06-16 01:21:28 +00003
4// Tests that certain miscellaneous features work in the MS ABI.
5
6struct Foo {
Reid Kleckner216d0a12016-06-16 20:08:51 +00007 virtual void f();
8 virtual void g();
9 virtual void h();
Adrian McCarthyd91bf392017-09-13 20:53:55 +000010 static void i(int, int);
Reid Kleckner45fe3762016-06-16 01:21:28 +000011 struct Nested {};
12};
13Foo f;
14Foo::Nested n;
Reid Klecknerc4871ed2016-06-22 18:34:45 +000015
Peter Collingbourneeeb56ab2016-09-13 01:13:19 +000016// CHECK: ![[Nested:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",
17// CHECK-SAME: identifier: ".?AUNested@Foo@@"
18
Reid Kleckner216d0a12016-06-16 20:08:51 +000019// CHECK: ![[Foo:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo",
Adrian McCarthyab1e7862016-07-21 18:43:20 +000020// CHECK-SAME: elements: ![[elements:[0-9]+]]
Reid Kleckner45fe3762016-06-16 01:21:28 +000021// CHECK-SAME: identifier: ".?AUFoo@@"
Reid Klecknerc4871ed2016-06-22 18:34:45 +000022
Adrian McCarthyd91bf392017-09-13 20:53:55 +000023// CHECK: ![[elements]] = !{![[vshape:[0-9]+]], ![[vptr:[0-9]+]], ![[Nested]], ![[f:[0-9]+]], ![[g:[0-9]+]], ![[h:[0-9]+]], ![[i:[0-9]+]]}
Reid Klecknerdc124992016-08-31 16:11:43 +000024
25// CHECK: ![[vshape]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: null, size: 96)
26
27// CHECK: ![[vptr]] = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$Foo",
28// CHECK-SAME: baseType: ![[vptr_ty:[0-9]+]],
29
30// CHECK: ![[vptr_ty]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[vshape]], size: 32
Adrian McCarthyab1e7862016-07-21 18:43:20 +000031
Adrian McCarthyab1e7862016-07-21 18:43:20 +000032// CHECK: ![[f]] = !DISubprogram(name: "f",
Reid Klecknerc4871ed2016-06-22 18:34:45 +000033// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0,
34// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
35
Adrian McCarthyab1e7862016-07-21 18:43:20 +000036// CHECK: ![[g]] = !DISubprogram(name: "g",
Reid Klecknerc4871ed2016-06-22 18:34:45 +000037// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 1,
38// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
39
Adrian McCarthyab1e7862016-07-21 18:43:20 +000040// CHECK: ![[h]] = !DISubprogram(name: "h",
Reid Klecknerc4871ed2016-06-22 18:34:45 +000041// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 2,
42// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
Adrian McCarthyd91bf392017-09-13 20:53:55 +000043
44// CHECK: ![[i]] = !DISubprogram(name: "i",
45// CHECK-SAME: flags: DIFlagPrototyped | DIFlagStaticMember
46// CHECK-NEXT: ![[dummy:[0-9]+]] = !DISubroutineType(types: ![[Signature:[0-9]+]])
47// CHECK: ![[Signature]] = !{null, ![[BasicInt:[0-9]+]], ![[BasicInt]]}
48// CHECK: ![[BasicInt]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
Reid Kleckner75557712018-11-16 18:47:41 +000049
50// CHECK: !{{[0-9]+}} = !{i32 2, !"CodeView", i32 1}
51// GHASH: !{{[0-9]+}} = !{i32 2, !"CodeViewGHash", i32 1}