|
1 |
| -# RUN: llc -march=x86-64 -run-pass machineverifier -o - %s | FileCheck %s |
2 |
| -# Simple round-trip test for DBG_VALUE_LIST. |
3 |
| -# CHECK: [[VAR_C:![0-9]+]] = !DILocalVariable(name: "c" |
4 |
| -# CHECK: DBG_VALUE_LIST [[VAR_C]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), $edi, $esi, debug-location |
5 |
| ---- | |
6 |
| - ; ModuleID = 'test.cpp' |
7 |
| - source_filename = "test.cpp" |
8 |
| - target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
9 |
| - target triple = "x86_64-unknown-linux-gnu" |
10 |
| - |
11 |
| - ; Function Attrs: norecurse nounwind readnone uwtable |
12 |
| - define dso_local i32 @_Z3fooii(i32 %a, i32 %b) local_unnamed_addr !dbg !7 { |
13 |
| - entry: |
14 |
| - call void @llvm.dbg.value(metadata i32 %a, metadata !12, metadata !DIExpression()), !dbg !15 |
15 |
| - call void @llvm.dbg.value(metadata i32 %b, metadata !13, metadata !DIExpression()), !dbg !15 |
16 |
| - call void @llvm.dbg.value(metadata i32 undef, metadata !14, metadata !DIExpression()), !dbg !15 |
17 |
| - %mul = mul nsw i32 %b, %a, !dbg !16 |
18 |
| - ret i32 %mul, !dbg !17 |
19 |
| - } |
20 |
| - |
21 |
| - ; Function Attrs: nounwind readnone speculatable willreturn |
22 |
| - declare void @llvm.dbg.value(metadata, metadata, metadata) |
23 |
| - |
24 |
| - !llvm.dbg.cu = !{!0} |
25 |
| - !llvm.module.flags = !{!3, !4, !5} |
26 |
| - !llvm.ident = !{!6} |
27 |
| - |
28 |
| - !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) |
29 |
| - !1 = !DIFile(filename: "test.cpp", directory: "/") |
30 |
| - !2 = !{} |
31 |
| - !3 = !{i32 7, !"Dwarf Version", i32 4} |
32 |
| - !4 = !{i32 2, !"Debug Info Version", i32 3} |
33 |
| - !5 = !{i32 1, !"wchar_size", i32 4} |
34 |
| - !6 = !{!"clang version 11.0.0"} |
35 |
| - !7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooii", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11) |
36 |
| - !8 = !DISubroutineType(types: !9) |
37 |
| - !9 = !{!10, !10, !10} |
38 |
| - !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
39 |
| - !11 = !{!12, !13, !14} |
40 |
| - !12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10) |
41 |
| - !13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 2, type: !10) |
42 |
| - !14 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !10) |
43 |
| - !15 = !DILocation(line: 0, scope: !7) |
44 |
| - !16 = !DILocation(line: 4, column: 12, scope: !7) |
45 |
| - !17 = !DILocation(line: 4, column: 3, scope: !7) |
46 |
| - |
47 |
| -... |
48 |
| ---- |
49 |
| -name: _Z3fooii |
50 |
| -body: | |
51 |
| - bb.0.entry: |
52 |
| - liveins: $edi, $esi |
53 |
| - |
54 |
| - DBG_VALUE $edi, $noreg, !12, !DIExpression(), debug-location !15 |
55 |
| - DBG_VALUE $esi, $noreg, !13, !DIExpression(), debug-location !15 |
56 |
| - $eax = MOV32rr $edi |
57 |
| - DBG_VALUE_LIST !14, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), $edi, $esi, debug-location !15 |
58 |
| - DBG_VALUE $esi, $noreg, !13, !DIExpression(), debug-location !15 |
59 |
| - DBG_VALUE $eax, $noreg, !12, !DIExpression(), debug-location !15 |
60 |
| - renamable $eax = nsw IMUL32rr killed renamable $eax, killed renamable $esi, implicit-def dead $eflags, debug-location !16 |
61 |
| - RET64 $eax, debug-location !17 |
62 |
| -
|
63 |
| -... |
64 |
| - |
| 1 | +# RUN: llc -march=x86-64 -run-pass machineverifier -o - %s | FileCheck %s |
| 2 | +# Simple round-trip test for DBG_VALUE_LIST. |
| 3 | +# CHECK: [[VAR_C:![0-9]+]] = !DILocalVariable(name: "c" |
| 4 | +# CHECK: DBG_VALUE_LIST [[VAR_C]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), $edi, $esi, debug-location |
| 5 | +--- | |
| 6 | + ; ModuleID = 'test.cpp' |
| 7 | + source_filename = "test.cpp" |
| 8 | + target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
| 9 | + target triple = "x86_64-unknown-linux-gnu" |
| 10 | + |
| 11 | + ; Function Attrs: norecurse nounwind readnone uwtable |
| 12 | + define dso_local i32 @_Z3fooii(i32 %a, i32 %b) local_unnamed_addr !dbg !7 { |
| 13 | + entry: |
| 14 | + call void @llvm.dbg.value(metadata i32 %a, metadata !12, metadata !DIExpression()), !dbg !15 |
| 15 | + call void @llvm.dbg.value(metadata i32 %b, metadata !13, metadata !DIExpression()), !dbg !15 |
| 16 | + call void @llvm.dbg.value(metadata i32 undef, metadata !14, metadata !DIExpression()), !dbg !15 |
| 17 | + %mul = mul nsw i32 %b, %a, !dbg !16 |
| 18 | + ret i32 %mul, !dbg !17 |
| 19 | + } |
| 20 | + |
| 21 | + ; Function Attrs: nounwind readnone speculatable willreturn |
| 22 | + declare void @llvm.dbg.value(metadata, metadata, metadata) |
| 23 | + |
| 24 | + !llvm.dbg.cu = !{!0} |
| 25 | + !llvm.module.flags = !{!3, !4, !5} |
| 26 | + !llvm.ident = !{!6} |
| 27 | + |
| 28 | + !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) |
| 29 | + !1 = !DIFile(filename: "test.cpp", directory: "/") |
| 30 | + !2 = !{} |
| 31 | + !3 = !{i32 7, !"Dwarf Version", i32 4} |
| 32 | + !4 = !{i32 2, !"Debug Info Version", i32 3} |
| 33 | + !5 = !{i32 1, !"wchar_size", i32 4} |
| 34 | + !6 = !{!"clang version 11.0.0"} |
| 35 | + !7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooii", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11) |
| 36 | + !8 = !DISubroutineType(types: !9) |
| 37 | + !9 = !{!10, !10, !10} |
| 38 | + !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 39 | + !11 = !{!12, !13, !14} |
| 40 | + !12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10) |
| 41 | + !13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 2, type: !10) |
| 42 | + !14 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !10) |
| 43 | + !15 = !DILocation(line: 0, scope: !7) |
| 44 | + !16 = !DILocation(line: 4, column: 12, scope: !7) |
| 45 | + !17 = !DILocation(line: 4, column: 3, scope: !7) |
| 46 | + |
| 47 | +... |
| 48 | +--- |
| 49 | +name: _Z3fooii |
| 50 | +body: | |
| 51 | + bb.0.entry: |
| 52 | + liveins: $edi, $esi |
| 53 | +
|
| 54 | + DBG_VALUE $edi, $noreg, !12, !DIExpression(), debug-location !15 |
| 55 | + DBG_VALUE $esi, $noreg, !13, !DIExpression(), debug-location !15 |
| 56 | + $eax = MOV32rr $edi |
| 57 | + DBG_VALUE_LIST !14, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), $edi, $esi, debug-location !15 |
| 58 | + DBG_VALUE $esi, $noreg, !13, !DIExpression(), debug-location !15 |
| 59 | + DBG_VALUE $eax, $noreg, !12, !DIExpression(), debug-location !15 |
| 60 | + renamable $eax = nsw IMUL32rr killed renamable $eax, killed renamable $esi, implicit-def dead $eflags, debug-location !16 |
| 61 | + RET64 $eax, debug-location !17 |
| 62 | +
|
| 63 | +... |
| 64 | + |
0 commit comments