1 ;; At the moment we emit an undef as soon as we encounter "dangling" variadic
\r
2 ;; dbg_value nodes. This does not reduce correctness but does reduce coverage.
\r
3 ;; We should make variadic dbg_values work in the same way as their
\r
4 ;; non-variadic counterparts here.
\r
5 ;; FIXME: When dangling nodes for a variadic dbg_value are found, we should be
\r
6 ;; able to recover the value in some cases.
\r
8 ; RUN: llc %s -start-after=codegenprepare -stop-before=finalize-isel -o - | FileCheck %s
\r
10 ;; Check that dangling debug info in the SelectionDAG build phase is handled
\r
11 ;; in the same way for variadic dbg_value ndoes as non-variadics.
\r
13 ;; Generated from the following source with -g -O2. Second dbg.value modified
\r
14 ;; to be variadic by hand:
\r
22 ; CHECK: ![[C:[0-9]+]] = !DILocalVariable(name: "c",
\r
23 ; CHECK: ![[D:[0-9]+]] = !DILocalVariable(name: "d",
\r
25 ; CHECK-DAG: DBG_VALUE %[[VREG:[0-9]]], $noreg, ![[C]], !DIExpression(), debug-location
\r
26 ; CHECK-DAG: DBG_VALUE_LIST ![[D]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_stack_value), $noreg, debug-location
\r
28 target triple = "x86_64-unknown-linux-gnu"
\r
30 @.str = private unnamed_addr constant [4 x i8] c"abc\00", align 1
\r
32 define dso_local void @b() local_unnamed_addr !dbg !7 {
\r
34 call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), metadata !11, metadata !DIExpression()), !dbg !15
\r
35 call void @llvm.dbg.value(metadata !DIArgList(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)), metadata !14, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_stack_value)), !dbg !15
\r
36 tail call void @a(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)) #3, !dbg !16
\r
40 declare !dbg !18 dso_local void @a(i8*) local_unnamed_addr
\r
41 declare void @llvm.dbg.value(metadata, metadata, metadata)
\r
44 !llvm.dbg.cu = !{!0}
\r
45 !llvm.module.flags = !{!3, !4, !5}
\r
48 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
\r
49 !1 = !DIFile(filename: "test.c", directory: "/")
\r
51 !3 = !{i32 7, !"Dwarf Version", i32 4}
\r
52 !4 = !{i32 2, !"Debug Info Version", i32 3}
\r
53 !5 = !{i32 1, !"wchar_size", i32 4}
\r
54 !6 = !{!"clang version 11.0.0"}
\r
55 !7 = distinct !DISubprogram(name: "b", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !10)
\r
56 !8 = !DISubroutineType(types: !9)
\r
59 !11 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !12)
\r
60 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
\r
61 !13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
\r
62 !14 = !DILocalVariable(name: "d", scope: !7, file: !1, line: 4, type: !12)
\r
63 !15 = !DILocation(line: 0, scope: !7)
\r
64 !16 = !DILocation(line: 5, column: 3, scope: !7)
\r
65 !17 = !DILocation(line: 6, column: 1, scope: !7)
\r
66 !18 = !DISubprogram(name: "a", scope: !1, file: !1, line: 1, type: !19, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
\r
67 !19 = !DISubroutineType(types: !20)
\r