David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
| 3 | ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
| 4 | |
| 5 | ; IR generated from clang -O0 with: |
| 6 | ; struct C { |
| 7 | ; ~C(); |
| 8 | ; }; |
| 9 | ; extern bool b; |
| 10 | ; void fun4() { b && (C(), 1); } |
| 11 | ; __attribute__((always_inline)) C::~C() { } |
| 12 | |
| 13 | ; CHECK: DW_TAG_structure_type |
| 14 | ; CHECK-NOT: DW_TAG |
| 15 | ; CHECK: DW_AT_name {{.*}} "C" |
| 16 | ; CHECK-NOT: {{DW_TAG|NULL}} |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 17 | ; CHECK: DW_TAG_subprogram |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 18 | ; CHECK-NOT: DW_TAG |
| 19 | ; CHECK: DW_AT_name {{.*}} "~C" |
| 20 | |
Frederic Riss | d1cfc3c | 2014-10-06 03:36:31 +0000 | [diff] [blame] | 21 | ; CHECK: DW_TAG_subprogram |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 22 | ; CHECK-NOT: DW_TAG |
| 23 | ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1CD1Ev" |
| 24 | ; CHECK-NOT: {{DW_TAG|NULL}} |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 25 | ; CHECK: DW_TAG_formal_parameter |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 26 | ; CHECK-NOT: DW_TAG |
| 27 | ; CHECK: DW_AT_name {{.*}} "this" |
| 28 | |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 29 | ; CHECK: DW_TAG_subprogram |
| 30 | ; CHECK-NOT: DW_TAG |
| 31 | ; CHECK: DW_AT_name {{.*}} "fun4" |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 32 | ; CHECK-NOT: {{DW_TAG|NULL}} |
David Blaikie | 6a150a8 | 2014-08-31 21:26:22 +0000 | [diff] [blame] | 33 | ; CHECK: DW_TAG_inlined_subroutine |
David Blaikie | b89e6d9 | 2014-07-01 03:11:59 +0000 | [diff] [blame] | 34 | ; CHECK-NOT: DW_TAG |
Frederic Riss | d1cfc3c | 2014-10-06 03:36:31 +0000 | [diff] [blame] | 35 | ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN1CD1Ev" |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 36 | ; CHECK-NOT: {{DW_TAG|NULL}} |
David Blaikie | 6a150a8 | 2014-08-31 21:26:22 +0000 | [diff] [blame] | 37 | ; CHECK: DW_TAG_formal_parameter |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 38 | ; CHECK-NOT: DW_TAG |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 39 | ; CHECK: DW_AT_abstract_origin {{.*}} "this" |
David Blaikie | c8caa17 | 2014-07-01 04:11:45 +0000 | [diff] [blame] | 40 | |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 41 | ; FIXME: D2 is actually inlined into D1 but doesn't show up here, possibly due |
| 42 | ; to there being no work in D2 (calling another member function from the dtor |
| 43 | ; causes D2 to show up, calling a free function doesn't). |
David Blaikie | c8caa17 | 2014-07-01 04:11:45 +0000 | [diff] [blame] | 44 | |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 45 | ; CHECK-NOT: DW_TAG |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 46 | ; CHECK: NULL |
| 47 | ; CHECK-NOT: DW_TAG |
| 48 | ; CHECK: NULL |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 49 | |
| 50 | %struct.C = type { i8 } |
| 51 | |
| 52 | @b = external global i8 |
| 53 | |
| 54 | ; Function Attrs: nounwind |
| 55 | define void @_Z4fun4v() #0 { |
| 56 | entry: |
| 57 | %this.addr.i.i = alloca %struct.C*, align 8, !dbg !21 |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 58 | %this.addr.i = alloca %struct.C*, align 8, !dbg !22 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 59 | %agg.tmp.ensured = alloca %struct.C, align 1 |
| 60 | %cleanup.cond = alloca i1 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 61 | %0 = load i8, i8* @b, align 1, !dbg !24 |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 62 | %tobool = trunc i8 %0 to i1, !dbg !24 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 63 | store i1 false, i1* %cleanup.cond |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 64 | br i1 %tobool, label %land.rhs, label %land.end, !dbg !24 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 65 | |
| 66 | land.rhs: ; preds = %entry |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 67 | store i1 true, i1* %cleanup.cond, !dbg !25 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 68 | br label %land.end |
| 69 | |
| 70 | land.end: ; preds = %land.rhs, %entry |
| 71 | %1 = phi i1 [ false, %entry ], [ true, %land.rhs ] |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 72 | %cleanup.is_active = load i1, i1* %cleanup.cond, !dbg !27 |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 73 | br i1 %cleanup.is_active, label %cleanup.action, label %cleanup.done, !dbg !27 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 74 | |
| 75 | cleanup.action: ; preds = %land.end |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 76 | store %struct.C* %agg.tmp.ensured, %struct.C** %this.addr.i, align 8, !dbg !22 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 77 | call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !29, metadata !{!"0x102"}), !dbg !31 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 78 | %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !22 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 79 | store %struct.C* %this1.i, %struct.C** %this.addr.i.i, align 8, !dbg !21 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 80 | call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i.i, metadata !32, metadata !{!"0x102"}), !dbg !33 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 81 | %this1.i.i = load %struct.C*, %struct.C** %this.addr.i.i, !dbg !21 |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 82 | br label %cleanup.done, !dbg !22 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 83 | |
| 84 | cleanup.done: ; preds = %cleanup.action, %land.end |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 85 | ret void, !dbg !34 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | ; Function Attrs: alwaysinline nounwind |
| 89 | define void @_ZN1CD1Ev(%struct.C* %this) unnamed_addr #1 align 2 { |
| 90 | entry: |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 91 | %this.addr.i = alloca %struct.C*, align 8, !dbg !37 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 92 | %this.addr = alloca %struct.C*, align 8 |
| 93 | store %struct.C* %this, %struct.C** %this.addr, align 8 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 94 | call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !29, metadata !{!"0x102"}), !dbg !38 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 95 | %this1 = load %struct.C*, %struct.C** %this.addr |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 96 | store %struct.C* %this1, %struct.C** %this.addr.i, align 8, !dbg !37 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 97 | call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !32, metadata !{!"0x102"}), !dbg !39 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 98 | %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !37 |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 99 | ret void, !dbg !37 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | ; Function Attrs: alwaysinline nounwind |
| 103 | define void @_ZN1CD2Ev(%struct.C* %this) unnamed_addr #1 align 2 { |
| 104 | entry: |
| 105 | %this.addr = alloca %struct.C*, align 8 |
| 106 | store %struct.C* %this, %struct.C** %this.addr, align 8 |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 107 | call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !32, metadata !{!"0x102"}), !dbg !40 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 108 | %this1 = load %struct.C*, %struct.C** %this.addr |
David Blaikie | 9408f52 | 2014-07-02 18:32:05 +0000 | [diff] [blame] | 109 | ret void, !dbg !41 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 113 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #2 |
David Blaikie | b9597a8 | 2014-06-15 19:34:26 +0000 | [diff] [blame] | 114 | |
| 115 | attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 116 | attributes #1 = { alwaysinline nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 117 | attributes #2 = { nounwind readnone } |
| 118 | |
| 119 | !llvm.dbg.cu = !{!0} |
| 120 | !llvm.module.flags = !{!18, !19} |
| 121 | !llvm.ident = !{!20} |
| 122 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 123 | !0 = !{!"0x11\004\00clang version 3.5.0 \000\00\000\00\001", !1, !2, !3, !11, !2, !2} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/<stdin>] [DW_LANG_C_plus_plus] |
| 124 | !1 = !{!"<stdin>", !"/tmp/dbginfo"} |
| 125 | !2 = !{} |
| 126 | !3 = !{!4} |
| 127 | !4 = !{!"0x13\00C\001\008\008\000\000\000", !5, null, null, !6, null, null, !"_ZTS1C"} ; [ DW_TAG_structure_type ] [C] [line 1, size 8, align 8, offset 0] [def] [from ] |
| 128 | !5 = !{!"PR20038.cpp", !"/tmp/dbginfo"} |
| 129 | !6 = !{!7} |
| 130 | !7 = !{!"0x2e\00~C\00~C\00\002\000\000\000\006\00256\000\002", !5, !"_ZTS1C", !8, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 2] [~C] |
| 131 | !8 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !9, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 132 | !9 = !{null, !10} |
| 133 | !10 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1C"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1C] |
| 134 | !11 = !{!12, !16, !17} |
| 135 | !12 = !{!"0x2e\00fun4\00fun4\00_Z4fun4v\005\000\001\000\006\00256\000\005", !5, !13, !14, null, void ()* @_Z4fun4v, null, null, !2} ; [ DW_TAG_subprogram ] [line 5] [def] [fun4] |
| 136 | !13 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/tmp/dbginfo/PR20038.cpp] |
| 137 | !14 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !15, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 138 | !15 = !{null} |
| 139 | !16 = !{!"0x2e\00~C\00~C\00_ZN1CD2Ev\006\000\001\000\006\00256\000\006", !5, !"_ZTS1C", !8, null, void (%struct.C*)* @_ZN1CD2Ev, null, !7, !2} ; [ DW_TAG_subprogram ] [line 6] [def] [~C] |
| 140 | !17 = !{!"0x2e\00~C\00~C\00_ZN1CD1Ev\006\000\001\000\006\00256\000\006", !5, !"_ZTS1C", !8, null, void (%struct.C*)* @_ZN1CD1Ev, null, !7, !2} ; [ DW_TAG_subprogram ] [line 6] [def] [~C] |
| 141 | !18 = !{i32 2, !"Dwarf Version", i32 4} |
| 142 | !19 = !{i32 2, !"Debug Info Version", i32 2} |
| 143 | !20 = !{!"clang version 3.5.0 "} |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 144 | !21 = !MDLocation(line: 6, scope: !17, inlinedAt: !22) |
| 145 | !22 = !MDLocation(line: 5, scope: !23) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 146 | !23 = !{!"0xb\005\000\003", !5, !12} ; [ DW_TAG_lexical_block ] [/tmp/dbginfo/PR20038.cpp] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 147 | !24 = !MDLocation(line: 5, scope: !12) |
| 148 | !25 = !MDLocation(line: 5, scope: !26) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 149 | !26 = !{!"0xb\005\000\001", !5, !12} ; [ DW_TAG_lexical_block ] [/tmp/dbginfo/PR20038.cpp] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 150 | !27 = !MDLocation(line: 5, scope: !28) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 151 | !28 = !{!"0xb\005\000\002", !5, !12} ; [ DW_TAG_lexical_block ] [/tmp/dbginfo/PR20038.cpp] |
| 152 | !29 = !{!"0x101\00this\0016777216\001088", !17, null, !30} ; [ DW_TAG_arg_variable ] [this] [line 0] |
| 153 | !30 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1C"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1C] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 154 | !31 = !MDLocation(line: 0, scope: !17, inlinedAt: !22) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 155 | !32 = !{!"0x101\00this\0016777216\001088", !16, null, !30} ; [ DW_TAG_arg_variable ] [this] [line 0] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 156 | !33 = !MDLocation(line: 0, scope: !16, inlinedAt: !21) |
| 157 | !34 = !MDLocation(line: 5, scope: !35) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 158 | !35 = !{!"0xb\005\000\005", !5, !36} ; [ DW_TAG_lexical_block ] [/tmp/dbginfo/PR20038.cpp] |
| 159 | !36 = !{!"0xb\005\000\004", !5, !12} ; [ DW_TAG_lexical_block ] [/tmp/dbginfo/PR20038.cpp] |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 160 | !37 = !MDLocation(line: 6, scope: !17) |
| 161 | !38 = !MDLocation(line: 0, scope: !17) |
| 162 | !39 = !MDLocation(line: 0, scope: !16, inlinedAt: !37) |
| 163 | !40 = !MDLocation(line: 0, scope: !16) |
| 164 | !41 = !MDLocation(line: 6, scope: !16) |