1 ; RUN: llc -O0 -dwarf-version=5 -debugger-tune=lldb -march=x86-64 -filetype=obj < %s \
2 ; RUN: | llvm-dwarfdump - | FileCheck --implicit-check-not=DW_OP_entry_value %s
3 ; RUN: llc -O0 -dwarf-version=5 -debugger-tune=gdb -march=x86-64 -filetype=obj < %s \
4 ; RUN: | llvm-dwarfdump - | FileCheck --implicit-check-not=DW_OP_entry_value %s
5 ; RUN: llc -force-instr-ref-livedebugvalues=1 -O0 -dwarf-version=5 -debugger-tune=lldb -march=x86-64 -filetype=obj < %s \
6 ; RUN: | llvm-dwarfdump - | FileCheck --implicit-check-not=DW_OP_entry_value %s
7 ; RUN: llc -force-instr-ref-livedebugvalues=1 -O0 -dwarf-version=5 -debugger-tune=gdb -march=x86-64 -filetype=obj < %s \
8 ; RUN: | llvm-dwarfdump - | FileCheck --implicit-check-not=DW_OP_entry_value %s
10 ; The call-site-params are created iff corresponding DISubprogram contains
11 ; the AllCallsDescribed DIFlag.
12 ; CHECK-NOT: DW_TAG_call_site_param
15 ; clang -gdwarf-5 -O0 test.c -S -emit-llvm
18 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-unknown-linux-gnu"
21 ; Function Attrs: noinline nounwind optnone uwtable
22 define dso_local void @fn1(i32 %x, i32 %y) !dbg !7 {
24 %x.addr = alloca i32, align 4
25 %y.addr = alloca i32, align 4
26 %u = alloca i32, align 4
27 %a = alloca i32, align 4
28 store i32 %x, i32* %x.addr, align 4
29 call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !11, metadata !DIExpression()), !dbg !12
30 store i32 %y, i32* %y.addr, align 4
31 call void @llvm.dbg.declare(metadata i32* %y.addr, metadata !13, metadata !DIExpression()), !dbg !14
32 call void @llvm.dbg.declare(metadata i32* %u, metadata !15, metadata !DIExpression()), !dbg !16
33 %0 = load i32, i32* %x.addr, align 4, !dbg !16
34 %1 = load i32, i32* %y.addr, align 4, !dbg !16
35 %add = add nsw i32 %0, %1, !dbg !16
36 store i32 %add, i32* %u, align 4, !dbg !16
37 %2 = load i32, i32* %x.addr, align 4, !dbg !17
38 %cmp = icmp sgt i32 %2, 1, !dbg !17
39 br i1 %cmp, label %if.then, label %if.else, !dbg !16
41 if.then: ; preds = %entry
42 %3 = load i32, i32* %u, align 4, !dbg !17
43 %add1 = add nsw i32 %3, 1, !dbg !17
44 store i32 %add1, i32* %u, align 4, !dbg !17
45 br label %if.end, !dbg !17
47 if.else: ; preds = %entry
48 %4 = load i32, i32* %u, align 4, !dbg !17
49 %add2 = add nsw i32 %4, 2, !dbg !17
50 store i32 %add2, i32* %u, align 4, !dbg !17
53 if.end: ; preds = %if.else, %if.then
54 call void @llvm.dbg.declare(metadata i32* %a, metadata !19, metadata !DIExpression()), !dbg !16
55 store i32 7, i32* %a, align 4, !dbg !16
56 %5 = load i32, i32* %a, align 4, !dbg !16
57 call void @fn2(i32 %5), !dbg !16
58 %6 = load i32, i32* %u, align 4, !dbg !16
59 %dec = add nsw i32 %6, -1, !dbg !16
60 store i32 %dec, i32* %u, align 4, !dbg !16
64 ; Function Attrs: nounwind readnone speculatable willreturn
65 declare void @llvm.dbg.declare(metadata, metadata, metadata)
67 declare dso_local void @fn2(i32)
70 !llvm.module.flags = !{!3, !4, !5}
73 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
74 !1 = !DIFile(filename: "test.c", directory: "/")
76 !3 = !{i32 7, !"Dwarf Version", i32 5}
77 !4 = !{i32 2, !"Debug Info Version", i32 3}
78 !5 = !{i32 1, !"wchar_size", i32 4}
79 !6 = !{!"clang version 11.0.0"}
80 !7 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
81 !8 = !DISubroutineType(types: !9)
82 !9 = !{null, !10, !10}
83 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
84 !11 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !1, line: 5, type: !10)
85 !12 = !DILocation(line: 5, column: 10, scope: !7)
86 !13 = !DILocalVariable(name: "y", arg: 2, scope: !7, file: !1, line: 5, type: !10)
87 !14 = !DILocation(line: 5, column: 17, scope: !7)
88 !15 = !DILocalVariable(name: "u", scope: !7, file: !1, line: 6, type: !10)
89 !16 = !DILocation(line: 6, column: 7, scope: !7)
90 !17 = !DILocation(line: 7, column: 7, scope: !18)
91 !18 = distinct !DILexicalBlock(scope: !7, file: !1, line: 7, column: 7)
92 !19 = !DILocalVariable(name: "a", scope: !7, file: !1, line: 11, type: !10)