|
1 | 1 | # RUN: llc %s -march=x86-64 -run-pass=livedebugvalues -o - \
|
2 | 2 | # RUN: -experimental-debug-variable-locations=true \
|
3 |
| -# RUN: | FileCheck %s -implicit-check-not=DBG_VALUE |
| 3 | +# RUN: | FileCheck %s -implicit-check-not=DBG_VALUE \ |
| 4 | +# RUN: --check-prefixes=CHECK,COMMON |
4 | 5 | # RUN: llc %s -march=x86-64 -run-pass=livedebugvalues -o - \
|
5 | 6 | # RUN: -experimental-debug-variable-locations=false \
|
6 |
| -# RUN: | FileCheck %s --check-prefixes=VARLOC -implicit-check-not=DBG_VALUE |
| 7 | +# RUN: | FileCheck %s -implicit-check-not=DBG_VALUE \ |
| 8 | +# RUN: --check-prefixes=VARLOC,COMMON |
7 | 9 | #
|
8 | 10 | # This test is designed to stimulate a simplification of variable-value
|
9 | 11 | # propagation in InstrRefBasedLDV. When we only have a single assignment of
|
|
63 | 65 | # VARLOC-LABEL: bb.3:
|
64 | 66 | # VARLOC: DBG_VALUE
|
65 | 67 | #
|
| 68 | +## Common tail for 'test2' -- this is checking that the assignment of undef or |
| 69 | +## $noreg in single-assignment mode doesn't lead to trouble further down the |
| 70 | +## line, specifically assertion failures. |
| 71 | +# |
| 72 | +# COMMON-LABEL: name: test2 |
| 73 | +# COMMON: DBG_VALUE $noreg |
66 | 74 | --- |
|
67 | 75 | define i32 @_Z8bb_to_bb() local_unnamed_addr !dbg !12 {
|
68 | 76 | entry:
|
69 | 77 | ret i32 0, !dbg !17
|
70 | 78 | }
|
71 | 79 |
|
| 80 | + define i32 @test2() local_unnamed_addr !dbg !112 { |
| 81 | + entry: |
| 82 | + ret i32 0, !dbg !117 |
| 83 | + } |
| 84 | + |
72 | 85 | !llvm.dbg.cu = !{!0}
|
73 | 86 | !llvm.module.flags = !{!7, !8, !9, !10}
|
74 | 87 | !llvm.ident = !{!11}
|
|
94 | 107 | !18 = distinct !DILexicalBlock(scope: !12, file: !1, line: 1, column: 1)
|
95 | 108 | !19 = distinct !DILexicalBlock(scope: !12, file: !1, line: 1, column: 1)
|
96 | 109 | !20 = !DILocation(line: 10, scope: !19)
|
| 110 | + !112 = distinct !DISubprogram(name: "test2", linkageName: "102", scope: !1, file: !1, line: 6, type: !13, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !115) |
| 111 | + !115 = !{!116} |
| 112 | + !116 = !DILocalVariable(name: "myVar", scope: !118, file: !1, line: 7, type: !6) |
| 113 | + !117 = !DILocation(line: 10, scope: !118) |
| 114 | + !118 = distinct !DILexicalBlock(scope: !112, file: !1, line: 1, column: 1) |
| 115 | + !119 = distinct !DILexicalBlock(scope: !112, file: !1, line: 1, column: 1) |
| 116 | + !120 = !DILocation(line: 10, scope: !119) |
97 | 117 |
|
98 | 118 | ...
|
99 | 119 | ---
|
@@ -136,3 +156,44 @@ body: |
|
136 | 156 |
|
137 | 157 | bb.6:
|
138 | 158 | RET 0, debug-location !17
|
| 159 | +... |
| 160 | +--- |
| 161 | +name: test2 |
| 162 | +debugValueSubstitutions: |
| 163 | + - { srcinst: 4, srcop: 0, dstinst: 3, dstop: 0, subreg: 0 } |
| 164 | +body: | |
| 165 | + bb.0.entry: |
| 166 | + successors: %bb.1, %bb.5, %bb.6 |
| 167 | +
|
| 168 | + $rax = MOV64ri 1, debug-instr-number 1, debug-location !117 |
| 169 | + JCC_1 %bb.5, 1, implicit $eflags |
| 170 | + JCC_1 %bb.6, 2, implicit $eflags |
| 171 | + JMP_1 %bb.1 |
| 172 | +
|
| 173 | + bb.1: |
| 174 | + successors: %bb.2, %bb.3 |
| 175 | +
|
| 176 | + DBG_VALUE $noreg, $noreg, !116, !DIExpression(), debug-location !117 |
| 177 | + JCC_1 %bb.3, 1, implicit $eflags, debug-location !117 |
| 178 | +
|
| 179 | + bb.2: |
| 180 | + successors: %bb.4 |
| 181 | +
|
| 182 | + JMP_1 %bb.4, debug-location !120 |
| 183 | +
|
| 184 | + bb.3: |
| 185 | + successors: %bb.4 |
| 186 | +
|
| 187 | + JMP_1 %bb.4, debug-location !117 |
| 188 | +
|
| 189 | + bb.4: |
| 190 | + successors: %bb.5, %bb.6 |
| 191 | +
|
| 192 | + JCC_1 %bb.5, 1, implicit $eflags, debug-location !117 |
| 193 | + JMP_1 %bb.6, debug-location !117 |
| 194 | +
|
| 195 | + bb.5: |
| 196 | + RET 0, debug-location !117 |
| 197 | +
|
| 198 | + bb.6: |
| 199 | + RET 0, debug-location !117 |
0 commit comments