Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/DebugInfo/MIR/X86/debug-call-site-param.mir
1 | # RUN: llc -debug-entry-values -filetype=obj -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s| llvm-dwarfdump - | FileCheck %s | ||||
---|---|---|---|---|---|
2 | # | ||||
3 | # extern void foo(int *a, int b, int c, int d, int e, int f); | ||||
4 | # extern int getVal(); | ||||
5 | # | ||||
6 | # void baa(int arg1, int arg2, int arg3) { | ||||
7 | # int local1 = getVal(); | ||||
8 | # foo(&local1, arg2, 10, 15, arg3 + 3, arg1 + arg2); | ||||
9 | # } | ||||
10 | # | ||||
11 | # CHECK: DW_TAG_GNU_call_site | ||||
12 | # CHECK: DW_AT_abstract_origin {{.*}} "getVal" | ||||
13 | # | ||||
14 | # CHECK: DW_TAG_GNU_call_site | ||||
15 | # CHECK: DW_AT_abstract_origin {{.*}} "foo" | ||||
16 | # CHECK: DW_TAG_GNU_call_site_parameter | ||||
17 | # CHECK-NEXT: DW_AT_location (DW_OP_reg2 RCX) | ||||
18 | # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit15) | ||||
19 | # CHECK: DW_TAG_GNU_call_site_parameter | ||||
20 | # CHECK-NEXT: DW_AT_location (DW_OP_reg1 RDX) | ||||
21 | # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit10) | ||||
22 | # CHECK: DW_TAG_GNU_call_site_parameter | ||||
23 | # CHECK-NEXT: DW_AT_location (DW_OP_reg4 RSI) | ||||
24 | # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg3 RBX+0) | ||||
25 | # CHECK: DW_TAG_GNU_call_site_parameter | ||||
26 | # CHECK-NEXT: DW_AT_location (DW_OP_reg5 RDI) | ||||
27 | # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_fbreg +12) | ||||
28 | # CHECK: DW_TAG_GNU_call_site_parameter | ||||
29 | # CHECK-NEXT: DW_AT_location (DW_OP_reg9 R9) | ||||
30 | # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg15 R15+0, DW_OP_breg3 RBX+0, DW_OP_plus) | ||||
31 | # CHECK: DW_TAG_GNU_call_site_parameter | ||||
32 | # CHECK-NEXT: DW_AT_location (DW_OP_reg8 R8) | ||||
33 | # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+3) | ||||
34 | | ||||
35 | --- | | ||||
36 | ; ModuleID = 'test.c' | ||||
37 | source_filename = "test.c" | ||||
38 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||||
39 | target triple = "x86_64-unknown-linux-gnu" | ||||
40 | | ||||
41 | ; Function Attrs: nounwind uwtable | ||||
42 | define dso_local void @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr !dbg !10 { | ||||
43 | entry: | ||||
44 | %local1 = alloca i32, align 4 | ||||
45 | call void @llvm.dbg.value(metadata i32 %arg1, metadata !15, metadata !DIExpression()), !dbg !19 | ||||
46 | call void @llvm.dbg.value(metadata i32 %arg2, metadata !16, metadata !DIExpression()), !dbg !20 | ||||
47 | call void @llvm.dbg.value(metadata i32 %arg3, metadata !17, metadata !DIExpression()), !dbg !21 | ||||
48 | %0 = bitcast i32* %local1 to i8*, !dbg !22 | ||||
49 | %call = tail call i32 (...) @getVal(), !dbg !23 | ||||
50 | call void @llvm.dbg.value(metadata i32 %call, metadata !18, metadata !DIExpression()), !dbg !24 | ||||
51 | store i32 %call, i32* %local1, align 4, !dbg !24 | ||||
52 | %add = add nsw i32 %arg3, 3, !dbg !24 | ||||
53 | %add1 = add nsw i32 %arg2, %arg1, !dbg !24 | ||||
54 | call void @llvm.dbg.value(metadata i32* %local1, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !24 | ||||
55 | call void @foo(i32* nonnull %local1, i32 %arg2, i32 10, i32 15, i32 %add, i32 %add1), !dbg !24 | ||||
56 | ret void, !dbg !24 | ||||
57 | } | ||||
58 | | ||||
59 | declare !dbg !4 dso_local i32 @getVal(...) local_unnamed_addr | ||||
60 | | ||||
61 | declare !dbg !5 dso_local void @foo(i32*, i32, i32, i32, i32, i32) local_unnamed_addr | ||||
62 | | ||||
63 | ; Function Attrs: nounwind readnone speculatable | ||||
64 | declare void @llvm.dbg.value(metadata, metadata, metadata) | ||||
65 | | ||||
66 | !llvm.dbg.cu = !{!0} | ||||
67 | !llvm.module.flags = !{!6, !7, !8} | ||||
68 | !llvm.ident = !{!9} | ||||
69 | | ||||
70 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None) | ||||
71 | !1 = !DIFile(filename: "test.c", directory: "/dir") | ||||
72 | !2 = !{} | ||||
73 | !3 = !{!4, !5} | ||||
74 | !4 = !DISubprogram(name: "getVal", scope: !1, file: !1, line: 2, spFlags: DISPFlagOptimized, retainedNodes: !2) | ||||
75 | !5 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) | ||||
76 | !6 = !{i32 2, !"Dwarf Version", i32 4} | ||||
77 | !7 = !{i32 2, !"Debug Info Version", i32 3} | ||||
78 | !8 = !{i32 1, !"wchar_size", i32 4} | ||||
79 | !9 = !{!"clang version 9.0.0"} | ||||
80 | !10 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 4, type: !11, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14) | ||||
81 | !11 = !DISubroutineType(types: !12) | ||||
82 | !12 = !{null, !13, !13, !13} | ||||
83 | !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) | ||||
84 | !14 = !{!15, !16, !17, !18} | ||||
85 | !15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) | ||||
86 | !16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) | ||||
87 | !17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) | ||||
88 | !18 = !DILocalVariable(name: "local1", scope: !10, file: !1, line: 5, type: !13) | ||||
89 | !19 = !DILocation(line: 4, column: 14, scope: !10) | ||||
90 | !20 = !DILocation(line: 4, column: 24, scope: !10) | ||||
91 | !21 = !DILocation(line: 4, column: 34, scope: !10) | ||||
92 | !22 = !DILocation(line: 5, column: 3, scope: !10) | ||||
93 | !23 = !DILocation(line: 5, column: 16, scope: !10) | ||||
94 | !24 = !DILocation(line: 5, column: 7, scope: !10) | ||||
95 | | ||||
96 | ... | ||||
97 | --- | ||||
98 | name: baa | ||||
99 | liveins: | ||||
100 | - { reg: '$edi', virtual-reg: '' } | ||||
101 | - { reg: '$esi', virtual-reg: '' } | ||||
102 | - { reg: '$edx', virtual-reg: '' } | ||||
103 | callSites: | ||||
104 | - { bb: 0, offset: 21, fwdArgRegs: [] } | ||||
105 | - { bb: 0, offset: 31, fwdArgRegs: | ||||
106 | - { arg: 0, reg: '$rdi' } | ||||
107 | - { arg: 1, reg: '$esi' } | ||||
108 | - { arg: 2, reg: '$edx' } | ||||
109 | - { arg: 3, reg: '$ecx' } | ||||
110 | - { arg: 4, reg: '$r8d' } | ||||
111 | - { arg: 5, reg: '$r9d' } } | ||||
112 | body: | | ||||
113 | bb.0.entry: | ||||
114 | liveins: $edi, $edx, $esi, $r15, $r14, $rbx | ||||
115 | | ||||
116 | DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !19 | ||||
117 | DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !20 | ||||
118 | DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !21 | ||||
119 | frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp | ||||
120 | CFI_INSTRUCTION def_cfa_offset 16 | ||||
121 | frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp | ||||
122 | CFI_INSTRUCTION def_cfa_offset 24 | ||||
123 | frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp | ||||
124 | CFI_INSTRUCTION def_cfa_offset 32 | ||||
125 | $rsp = frame-setup SUB64ri8 $rsp, 16, implicit-def dead $eflags | ||||
126 | CFI_INSTRUCTION def_cfa_offset 48 | ||||
127 | CFI_INSTRUCTION offset $rbx, -32 | ||||
128 | CFI_INSTRUCTION offset $r14, -24 | ||||
129 | CFI_INSTRUCTION offset $r15, -16 | ||||
130 | $r14d = MOV32rr $edx, implicit-def $r14 | ||||
131 | $ebx = MOV32rr $esi, implicit-def $rbx | ||||
132 | $r15d = MOV32rr $edi, implicit-def $r15 | ||||
133 | DBG_VALUE $r14d, $noreg, !17, !DIExpression(), debug-location !21 | ||||
134 | DBG_VALUE $ebx, $noreg, !16, !DIExpression(), debug-location !20 | ||||
135 | DBG_VALUE $r15d, $noreg, !15, !DIExpression(), debug-location !19 | ||||
136 | dead $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags, implicit-def $al, debug-location !23 | ||||
137 | CALL64pcrel32 @getVal, csr_64, implicit $rsp, implicit $ssp, implicit $al, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !23 | ||||
138 | DBG_VALUE $eax, $noreg, !18, !DIExpression(), debug-location !24 | ||||
139 | MOV32mr $rsp, 1, $noreg, 12, $noreg, killed renamable $eax, debug-location !24 :: (store 4 into %ir.local1) | ||||
140 | renamable $r8d = LEA64_32r killed renamable $r14, 1, $noreg, 3, $noreg, debug-location !24 | ||||
141 | renamable $r9d = LEA64_32r killed renamable $r15, 1, renamable $rbx, 0, $noreg, debug-location !24 | ||||
142 | DBG_VALUE $rsp, $noreg, !18, !DIExpression(DW_OP_plus_uconst, 12, DW_OP_deref), debug-location !24 | ||||
143 | renamable $rdi = LEA64r $rsp, 1, $noreg, 12, $noreg | ||||
144 | $esi = MOV32rr $ebx, implicit killed $rbx, debug-location !24 | ||||
145 | $edx = MOV32ri 10, debug-location !24 | ||||
146 | $ecx = MOV32ri 15, debug-location !24 | ||||
147 | CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit $esi, implicit $edx, implicit killed $ecx, implicit $r8d, implicit $r9d, implicit-def $rsp, implicit-def $ssp, debug-location !24 | ||||
148 | $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !24 | ||||
149 | CFI_INSTRUCTION def_cfa_offset 32, debug-location !24 | ||||
150 | $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !24 | ||||
151 | CFI_INSTRUCTION def_cfa_offset 24, debug-location !24 | ||||
152 | $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !24 | ||||
153 | CFI_INSTRUCTION def_cfa_offset 16, debug-location !24 | ||||
154 | $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !24 | ||||
155 | CFI_INSTRUCTION def_cfa_offset 8, debug-location !24 | ||||
156 | RETQ debug-location !24 | ||||
157 | | ||||
158 | ... |