blob: b2889408a670c1ce0c2206b0f25acf027a8c7f77 [file] [log] [blame]
Peter Collingbournea1f86252016-03-17 23:58:03 +00001; REQUIRES: object-emission
2
3; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
Adrian Prantl16aa4cf2017-09-11 23:05:20 +00004; RUN: llvm-dwarfdump -v %t | FileCheck %s
Peter Collingbournea1f86252016-03-17 23:58:03 +00005
6; Generated from the following C++ source code:
7;
8; struct A {
9; virtual void f();
10; virtual void g();
11; };
12;
13; void A::f() {}
14; void A::g() {}
15;
16; and manually edited to set virtualIndex attribute on the A::g subprogram to
17; 4294967295.
18
19; CHECK: DW_TAG_subprogram [
20; CHECK: DW_AT_vtable_elem_location [DW_FORM_exprloc] (<0x2> 10 00 )
21
22; CHECK: DW_TAG_subprogram [
23; CHECK-NOT: DW_AT_vtable_elem_location
24
25%struct.A = type { i32 (...)** }
26
27@_ZTV1A = unnamed_addr constant [4 x i8*] [i8* null, i8* null, i8* bitcast (void (%struct.A*)* @_ZN1A1fEv to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1gEv to i8*)], align 8
28
29define void @_ZN1A1fEv(%struct.A* %this) unnamed_addr !dbg !18 {
30 ret void
31}
32
33define void @_ZN1A1gEv(%struct.A* %this) unnamed_addr !dbg !19 {
34 ret void
35}
36
37!llvm.dbg.cu = !{!0}
38!llvm.module.flags = !{!20, !21}
39!llvm.ident = !{!22}
40
Adrian Prantl75819ae2016-04-15 15:57:41 +000041!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3)
Peter Collingbournea1f86252016-03-17 23:58:03 +000042!1 = !DIFile(filename: "x", directory: "x")
43!2 = !{}
44!3 = !{!4}
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000045!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 64, align: 64, elements: !5, vtableHolder: !4, identifier: "_ZTS1A")
Peter Collingbournea1f86252016-03-17 23:58:03 +000046!5 = !{!6, !12, !16}
47!6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !1, file: !1, baseType: !7, size: 64, flags: DIFlagArtificial)
48!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)
49!8 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !9, size: 64)
50!9 = !DISubroutineType(types: !10)
51!10 = !{!11}
52!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000053!12 = !DISubprogram(name: "f", linkageName: "_ZN1A1fEv", scope: !4, file: !1, line: 2, type: !13, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !4, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
Peter Collingbournea1f86252016-03-17 23:58:03 +000054!13 = !DISubroutineType(types: !14)
55!14 = !{null, !15}
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000056!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
57!16 = !DISubprogram(name: "g", linkageName: "_ZN1A1gEv", scope: !4, file: !1, line: 3, type: !13, isLocal: false, isDefinition: false, scopeLine: 3, containingType: !4, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 4294967295, flags: DIFlagPrototyped, isOptimized: false)
58!18 = distinct !DISubprogram(name: "f", linkageName: "_ZN1A1fEv", scope: !4, file: !1, line: 6, type: !13, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !12, variables: !2)
59!19 = distinct !DISubprogram(name: "g", linkageName: "_ZN1A1gEv", scope: !4, file: !1, line: 7, type: !13, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !16, variables: !2)
Peter Collingbournea1f86252016-03-17 23:58:03 +000060!20 = !{i32 2, !"Dwarf Version", i32 4}
61!21 = !{i32 2, !"Debug Info Version", i32 3}
62!22 = !{!"clang version 3.9.0 (trunk 263469) (llvm/trunk 263156)"}
63!23 = !DILocalVariable(name: "this", arg: 1, scope: !18, type: !24, flags: DIFlagArtificial | DIFlagObjectPointer)
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000064!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)
Peter Collingbournea1f86252016-03-17 23:58:03 +000065!25 = !DIExpression()
66!26 = !DILocation(line: 0, scope: !18)
67!27 = !DILocation(line: 6, column: 14, scope: !18)
68!28 = !DILocalVariable(name: "this", arg: 1, scope: !19, type: !24, flags: DIFlagArtificial | DIFlagObjectPointer)
69!29 = !DILocation(line: 0, scope: !19)
70!30 = !DILocation(line: 7, column: 14, scope: !19)