David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s |
David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 4 | |
| 5 | ; generated by clang from: |
| 6 | ; struct foo { |
| 7 | ; void f1(); |
| 8 | ; void f2(); |
| 9 | ; }; |
| 10 | ; |
| 11 | ; void foo::f1() { |
| 12 | ; } |
| 13 | |
| 14 | ; CHECK: DW_TAG_structure_type |
| 15 | ; CHECK-NEXT: DW_AT_name {{.*}} "foo" |
| 16 | ; CHECK-NOT: NULL |
| 17 | ; CHECK: DW_TAG_subprogram |
| 18 | ; CHECK-NOT: NULL |
| 19 | ; CHECK: DW_AT_name {{.*}} "f1" |
| 20 | ; CHECK: DW_TAG_subprogram |
| 21 | ; CHECK-NOT: NULL |
| 22 | ; CHECK: DW_AT_name {{.*}} "f2" |
| 23 | |
| 24 | |
| 25 | %struct.foo = type { i8 } |
| 26 | |
| 27 | ; Function Attrs: nounwind uwtable |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 28 | define void @_ZN3foo2f1Ev(%struct.foo* %this) #0 align 2 !dbg !14 { |
David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 29 | entry: |
| 30 | %this.addr = alloca %struct.foo*, align 8 |
| 31 | store %struct.foo* %this, %struct.foo** %this.addr, align 8 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 32 | call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !16, metadata !DIExpression()), !dbg !18 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 33 | %this1 = load %struct.foo*, %struct.foo** %this.addr |
David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 34 | ret void, !dbg !19 |
| 35 | } |
| 36 | |
| 37 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 38 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 39 | |
| 40 | attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 41 | attributes #1 = { nounwind readnone } |
| 42 | |
| 43 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 44 | !llvm.module.flags = !{!15, !20} |
David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 45 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 46 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 47 | !1 = !DIFile(filename: "member-order.cpp", directory: "/tmp/dbginfo") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 48 | !2 = !{} |
| 49 | !3 = !{!4} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 50 | !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS3foo") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 51 | !5 = !{!6, !11} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 52 | !6 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7) |
| 53 | !7 = !DISubroutineType(types: !8) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 54 | !8 = !{null, !9} |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 55 | !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 56 | !10 = !{i32 786468} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 57 | !11 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !4, type: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 58 | !12 = !{i32 786468} |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 59 | !14 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: null, type: !7, declaration: !6, retainedNodes: !2) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 60 | !15 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 61 | !16 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !17) |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 62 | !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 63 | !18 = !DILocation(line: 0, scope: !14) |
| 64 | !19 = !DILocation(line: 7, scope: !14) |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 65 | !20 = !{i32 1, !"Debug Info Version", i32 3} |