1 # RUN: llc -run-pass machineverifier -o - %s | FileCheck %s
2 # RUN: llc --passes='machine-function(verify)' -o - %s | FileCheck %s
3 # Simple round-trip test for DBG_VALUE_LIST.
4 # CHECK: [[VAR_C:![0-9]+]] = !DILocalVariable(name: "c"
5 # 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
7 ; ModuleID = 'test.cpp'
8 source_filename = "test.cpp"
9 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
10 target triple = "x86_64-unknown-linux-gnu"
12 ; Function Attrs: norecurse nounwind readnone uwtable
13 define dso_local i32 @_Z3fooii(i32 %a, i32 %b) local_unnamed_addr !dbg !7 {
15 call void @llvm.dbg.value(metadata i32 %a, metadata !12, metadata !DIExpression()), !dbg !15
16 call void @llvm.dbg.value(metadata i32 %b, metadata !13, metadata !DIExpression()), !dbg !15
17 call void @llvm.dbg.value(metadata i32 undef, metadata !14, metadata !DIExpression()), !dbg !15
18 %mul = mul nsw i32 %b, %a, !dbg !16
19 ret i32 %mul, !dbg !17
22 ; Function Attrs: nounwind readnone speculatable willreturn
23 declare void @llvm.dbg.value(metadata, metadata, metadata)
26 !llvm.module.flags = !{!3, !4, !5}
29 !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)
30 !1 = !DIFile(filename: "test.cpp", directory: "/")
32 !3 = !{i32 7, !"Dwarf Version", i32 4}
33 !4 = !{i32 2, !"Debug Info Version", i32 3}
34 !5 = !{i32 1, !"wchar_size", i32 4}
35 !6 = !{!"clang version 11.0.0"}
36 !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)
37 !8 = !DISubroutineType(types: !9)
39 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
40 !11 = !{!12, !13, !14}
41 !12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10)
42 !13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 2, type: !10)
43 !14 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !10)
44 !15 = !DILocation(line: 0, scope: !7)
45 !16 = !DILocation(line: 4, column: 12, scope: !7)
46 !17 = !DILocation(line: 4, column: 3, scope: !7)
55 DBG_VALUE $edi, $noreg, !12, !DIExpression(), debug-location !15
56 DBG_VALUE $esi, $noreg, !13, !DIExpression(), debug-location !15
58 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
59 DBG_VALUE $esi, $noreg, !13, !DIExpression(), debug-location !15
60 DBG_VALUE $eax, $noreg, !12, !DIExpression(), debug-location !15
61 renamable $eax = nsw IMUL32rr killed renamable $eax, killed renamable $esi, implicit-def dead $eflags, debug-location !16
62 RET64 $eax, debug-location !17