David Blaikie | 309ffe4 | 2013-10-04 01:39:59 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
Timur Iskhodzhanov | f166f6c | 2014-01-30 01:39:17 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=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 |
| 28 | define void @_ZN3foo2f1Ev(%struct.foo* %this) #0 align 2 { |
| 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 | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 32 | call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !16, metadata !{!"0x102"}), !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 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 46 | !0 = !{!"0x11\004\00clang version 3.4 \000\00\000\00\000", !1, !2, !3, !13, !2, !2} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/member-order.cpp] [DW_LANG_C_plus_plus] |
| 47 | !1 = !{!"member-order.cpp", !"/tmp/dbginfo"} |
| 48 | !2 = !{} |
| 49 | !3 = !{!4} |
| 50 | !4 = !{!"0x13\00foo\001\008\008\000\000\000", !1, null, null, !5, null, null, !"_ZTS3foo"} ; [ DW_TAG_structure_type ] [foo] [line 1, size 8, align 8, offset 0] [def] [from ] |
| 51 | !5 = !{!6, !11} |
| 52 | !6 = !{!"0x2e\00f1\00f1\00_ZN3foo2f1Ev\002\000\000\000\006\00256\000\002", !1, !4, !7, null, null, null, i32 0, !10} ; [ DW_TAG_subprogram ] [line 2] [f1] |
| 53 | !7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 54 | !8 = !{null, !9} |
| 55 | !9 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS3foo"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS3foo] |
| 56 | !10 = !{i32 786468} |
| 57 | !11 = !{!"0x2e\00f2\00f2\00_ZN3foo2f2Ev\003\000\000\000\006\00256\000\003", !1, !4, !7, null, null, null, i32 0, !12} ; [ DW_TAG_subprogram ] [line 3] [f2] |
| 58 | !12 = !{i32 786468} |
| 59 | !13 = !{!14} |
| 60 | !14 = !{!"0x2e\00f1\00f1\00_ZN3foo2f1Ev\006\000\001\000\006\00256\000\006", !1, null, !7, null, void (%struct.foo*)* @_ZN3foo2f1Ev, null, !6, !2} ; [ DW_TAG_subprogram ] [line 6] [def] [f1] |
| 61 | !15 = !{i32 2, !"Dwarf Version", i32 4} |
| 62 | !16 = !{!"0x101\00this\0016777216\001088", !14, null, !17} ; [ DW_TAG_arg_variable ] [this] [line 0] |
| 63 | !17 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS3foo"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS3foo] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 64 | !18 = !MDLocation(line: 0, scope: !14) |
| 65 | !19 = !MDLocation(line: 7, scope: !14) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 66 | !20 = !{i32 1, !"Debug Info Version", i32 2} |