blob: 52e9290eaccd5c966c00e1693702c6485cae93ff [file] [log] [blame]
Adrian Prantlfb2add22016-02-29 19:49:46 +00001; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=all - | FileCheck %s
Adrian Prantla1ffd1a2013-07-10 01:53:37 +00002; ModuleID = 'aggregate-indirect-arg.cpp'
3; extracted from debuginfo-tests/aggregate-indirect-arg.cpp
4
Adrian Prantl4293ee92015-12-17 18:25:51 +00005; v should be a pointer.
Adrian Prantlfb2add22016-02-29 19:49:46 +00006; CHECK: .debug_info contents:
Adrian Prantl4293ee92015-12-17 18:25:51 +00007; CHECK: DW_TAG_subprogram
8; CHECK: DW_AT_specification {{.*}} "_ZN1A3fooE4SVal"
9; CHECK-NOT: DW_TAG_subprogram
10; CHECK: DW_TAG_formal_parameter
11; CHECK: DW_AT_name {{.*}} "this"
12; CHECK-NOT: DW_TAG_subprogram
13; CHECK: DW_TAG_formal_parameter
Adrian Prantlfb2add22016-02-29 19:49:46 +000014; CHECK-NEXT: DW_AT_location [DW_FORM_data4] (0x00000000)
Adrian Prantl4293ee92015-12-17 18:25:51 +000015; CHECK-NEXT: DW_AT_name {{.*}} "v"
Adrian Prantlfb2add22016-02-29 19:49:46 +000016; CHECK: .debug_loc contents:
17; rsi+0
18; CHECK: Location description: 74 00
Adrian Prantla1ffd1a2013-07-10 01:53:37 +000019
20target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
21target triple = "x86_64-apple-macosx10.9.0"
22
23%class.SVal = type { i8*, i32 }
24%class.A = type { i8 }
25
26declare void @_Z3barR4SVal(%class.SVal* %v)
Adrian Prantl87b7eb92014-10-01 18:55:02 +000027declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
Keno Fischer00cbf9a2015-12-19 02:02:44 +000028declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
Adrian Prantla1ffd1a2013-07-10 01:53:37 +000029declare i32 @main()
30; Function Attrs: nounwind ssp uwtable
Peter Collingbourned4bff302015-11-05 22:03:56 +000031define linkonce_odr void @_ZN1A3fooE4SVal(%class.A* %this, %class.SVal* %v) nounwind ssp uwtable align 2 !dbg !35 {
Adrian Prantla1ffd1a2013-07-10 01:53:37 +000032entry:
33 %this.addr = alloca %class.A*, align 8
34 store %class.A* %this, %class.A** %this.addr, align 8
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000035 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !59, metadata !DIExpression()), !dbg !61
Keno Fischer00cbf9a2015-12-19 02:02:44 +000036 call void @llvm.dbg.value(metadata %class.SVal* %v, i64 0, metadata !62, metadata !DIExpression(DW_OP_deref)), !dbg !61
David Blaikiea79ac142015-02-27 21:17:42 +000037 %this1 = load %class.A*, %class.A** %this.addr
Adrian Prantla1ffd1a2013-07-10 01:53:37 +000038 call void @_Z3barR4SVal(%class.SVal* %v), !dbg !61
39 ret void, !dbg !61
40}
41declare void @_ZN4SValD1Ev(%class.SVal* %this)
42declare void @_ZN4SValD2Ev(%class.SVal* %this)
43
44!llvm.dbg.cu = !{!0}
Manman Ren409558f2013-11-22 21:49:45 +000045!llvm.module.flags = !{!47, !68}
Adrian Prantla1ffd1a2013-07-10 01:53:37 +000046
Adrian Prantl75819ae2016-04-15 15:57:41 +000047!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000048!1 = !DIFile(filename: "aggregate-indirect-arg.cpp", directory: "")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000049!2 = !{}
Adrian Prantl75819ae2016-04-15 15:57:41 +000050!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barR4SVal", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000051!5 = !DIFile(filename: "aggregate-indirect-arg.cpp", directory: "")
52!6 = !DISubroutineType(types: !7)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000053!7 = !{null, !8}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000054!8 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !9)
55!9 = !DICompositeType(tag: DW_TAG_class_type, name: "SVal", line: 12, size: 128, align: 64, file: !1, elements: !10)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000056!10 = !{!11, !14, !16, !21, !23}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000057!11 = !DIDerivedType(tag: DW_TAG_member, name: "Data", line: 15, size: 64, align: 64, file: !1, scope: !9, baseType: !12)
58!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13)
59!13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: null)
60!14 = !DIDerivedType(tag: DW_TAG_member, name: "Kind", line: 16, size: 32, align: 32, offset: 64, file: !1, scope: !9, baseType: !15)
61!15 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
62!16 = !DISubprogram(name: "~SVal", line: 14, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !9, type: !17)
63!17 = !DISubroutineType(types: !18)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000064!18 = !{null, !19}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000065!19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !9)
66!21 = !DISubprogram(name: "SVal", line: 12, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 12, file: !1, scope: !9, type: !17)
67!23 = !DISubprogram(name: "SVal", line: 12, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 12, file: !1, scope: !9, type: !24)
68!24 = !DISubroutineType(types: !25)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000069!25 = !{null, !19, !26}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000070!26 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !27)
71!27 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
Adrian Prantl75819ae2016-04-15 15:57:41 +000072!29 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 25, file: !1, scope: !5, type: !30, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000073!30 = !DISubroutineType(types: !31)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000074!31 = !{!32}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000075!32 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
Adrian Prantl75819ae2016-04-15 15:57:41 +000076!33 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD1Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2)
77!34 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD2Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2)
78!35 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1A3fooE4SVal", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 22, file: !1, scope: null, type: !36, declaration: !41, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000079!36 = !DISubroutineType(types: !37)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000080!37 = !{null, !38, !9}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000081!38 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !39)
82!39 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 20, size: 8, align: 8, file: !1, elements: !40)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000083!40 = !{!41, !43}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000084!41 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooE4SVal", line: 22, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 22, file: !1, scope: !39, type: !36)
85!43 = !DISubprogram(name: "A", line: 20, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !1, scope: !39, type: !44)
86!44 = !DISubroutineType(types: !45)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000087!45 = !{null, !38}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000088!47 = !{i32 2, !"Dwarf Version", i32 3}
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000089!48 = !DILocalVariable(name: "v", line: 19, arg: 1, scope: !4, file: !5, type: !8)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000090!49 = !DILocation(line: 19, scope: !4)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000091!50 = !DILocalVariable(name: "v", line: 26, scope: !29, file: !5, type: !9)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000092!51 = !DILocation(line: 26, scope: !29)
93!52 = !DILocation(line: 27, scope: !29)
94!53 = !DILocation(line: 28, scope: !29)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000095!54 = !DILocalVariable(name: "a", line: 29, scope: !29, file: !5, type: !39)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000096!55 = !DILocation(line: 29, scope: !29)
97!56 = !DILocation(line: 30, scope: !29)
98!57 = !DILocation(line: 31, scope: !29)
99!58 = !DILocation(line: 32, scope: !29)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +0000100!59 = !DILocalVariable(name: "this", line: 22, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, file: !5, type: !60)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +0000101!60 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !39)
102!61 = !DILocation(line: 22, scope: !35)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +0000103!62 = !DILocalVariable(name: "v", line: 22, arg: 2, scope: !35, file: !5, type: !9)
104!63 = !DILocalVariable(name: "this", line: 14, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !33, file: !5, type: !64)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +0000105!64 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)
106!65 = !DILocation(line: 14, scope: !33)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +0000107!66 = !DILocalVariable(name: "this", line: 14, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !34, file: !5, type: !64)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +0000108!67 = !DILocation(line: 14, scope: !34)
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +0000109!68 = !{i32 1, !"Debug Info Version", i32 3}