1 ;; FIXME: We currently don't do any special bookkeeping for unused args used by
\r
2 ;; variadic dbg_values. When/if we support them, the DBG_VALUE_LIST should be
\r
3 ;; updated accordingly.
\r
5 ; RUN: llc %s -start-after=codegenprepare -stop-before=finalize-isel -o - | FileCheck %s
\r
7 ;; Check that unused argument values are handled the same way for variadic
\r
8 ;; dbg_values as non-variadics.
\r
10 ; CHECK: ![[A:[0-9]+]] = !DILocalVariable(name: "a",
\r
11 ; CHECK: ![[B:[0-9]+]] = !DILocalVariable(name: "b",
\r
12 ; CHECK: ![[C:[0-9]+]] = !DILocalVariable(name: "c",
\r
14 ; CHECK: DBG_VALUE $ecx, $noreg, ![[A]], !DIExpression(), debug-location
\r
15 ; CHECK: DBG_VALUE $edx, $noreg, ![[B]], !DIExpression(), debug-location
\r
16 ; CHECK: DBG_VALUE $noreg, $noreg, ![[C]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), debug-location
\r
18 target triple = "x86_64-pc-windows-msvc19.16.27034"
\r
19 define dso_local i32 @"?foo@@YAHHH@Z"(i32 %a, i32 %b) local_unnamed_addr !dbg !8 {
\r
21 call void @llvm.dbg.value(metadata i32 %a, metadata !14, metadata !DIExpression()), !dbg !17
\r
22 call void @llvm.dbg.value(metadata i32 %b, metadata !15, metadata !DIExpression()), !dbg !17
\r
23 call void @llvm.dbg.value(metadata !DIArgList(i32 %a, i32 %b), metadata !16, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value)), !dbg !17
\r
27 declare void @llvm.dbg.value(metadata, metadata, metadata)
\r
29 !llvm.dbg.cu = !{!0}
\r
30 !llvm.module.flags = !{!3, !4, !5, !6}
\r
33 !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)
\r
34 !1 = !DIFile(filename: "test.cpp", directory: "/")
\r
36 !3 = !{i32 2, !"CodeView", i32 1}
\r
37 !4 = !{i32 2, !"Debug Info Version", i32 3}
\r
38 !5 = !{i32 1, !"wchar_size", i32 2}
\r
39 !6 = !{i32 7, !"PIC Level", i32 2}
\r
40 !7 = !{!"clang version 11.0.0"}
\r
41 !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)
\r
42 !9 = !DIFile(filename: "test.cpp", directory: "/")
\r
43 !10 = !DISubroutineType(types: !11)
\r
44 !11 = !{!12, !12, !12}
\r
45 !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
\r
46 !13 = !{!14, !15, !16}
\r
47 !14 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !9, line: 1, type: !12)
\r
48 !15 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !9, line: 1, type: !12)
\r
49 !16 = !DILocalVariable(name: "c", scope: !8, file: !9, line: 2, type: !12)
\r
50 !17 = !DILocation(line: 0, scope: !8)
\r