1; RUN: llc %s -start-after=codegenprepare --experimental-debug-variable-locations=false -stop-before=finalize-isel -o - | FileCheck %s 2; RUN: llc %s -start-after=codegenprepare --experimental-debug-variable-locations -stop-before=finalize-isel -o - | FileCheck %s 3 4; RUN: llc %s -start-after=codegenprepare --experimental-debug-variable-locations=false -stop-before=finalize-isel -o - --try-experimental-debuginfo-iterators | FileCheck %s 5; RUN: llc %s -start-after=codegenprepare --experimental-debug-variable-locations -stop-before=finalize-isel -o - --try-experimental-debuginfo-iterators | FileCheck %s 6 7;; %y is unused and cannot (FIXME: currently) be salvaged. Ensure that the 8;; variadic dbg_value using %y becomes undef. 9 10; CHECK: ![[C:[0-9]+]] = !DILocalVariable(name: "c", 11; CHECK: DBG_VALUE $noreg, $noreg, ![[C]], !DIExpression(), debug-location 12 13target triple = "x86_64-pc-windows-msvc19.16.27034" 14define dso_local i32 @"?foo@@YAHHH@Z"(i32 %a, i32 %b) local_unnamed_addr !dbg !8 { 15entry: 16 %x = add i32 %a, %b 17 %y = mul i32 %x, %b 18 call void @llvm.dbg.value(metadata !DIArgList(i32 %x, i32 %y), metadata !16, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value)), !dbg !17 19 ret i32 %x 20} 21 22declare void @llvm.dbg.value(metadata, metadata, metadata) 23 24!llvm.dbg.cu = !{!0} 25!llvm.module.flags = !{!3, !4, !5, !6} 26!llvm.ident = !{!7} 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, nameTableKind: None) 29!1 = !DIFile(filename: "test.cpp", directory: "/") 30!2 = !{} 31!3 = !{i32 2, !"CodeView", i32 1} 32!4 = !{i32 2, !"Debug Info Version", i32 3} 33!5 = !{i32 1, !"wchar_size", i32 2} 34!6 = !{i32 7, !"PIC Level", i32 2} 35!7 = !{!"clang version 11.0.0"} 36!8 = distinct !DISubprogram(name: "foo", linkageName: "?foo@@YAHHH@Z", scope: !9, file: !9, line: 1, type: !10, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13) 37!9 = !DIFile(filename: "test.cpp", directory: "/") 38!10 = !DISubroutineType(types: !11) 39!11 = !{!12, !12, !12} 40!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 41!13 = !{!14, !15, !16} 42!14 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !9, line: 1, type: !12) 43!15 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !9, line: 1, type: !12) 44!16 = !DILocalVariable(name: "c", scope: !8, file: !9, line: 2, type: !12) 45!17 = !DILocation(line: 0, scope: !8) 46