1 ; RUN: llc -O3 -debug-entry-values -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 ; Verify that we produce call site entries for the zero-valued parameters.
8 ; Based on the following reproducer:
11 ; extern void callee(uint8_t, uint16_t, uint32_t, void *);
13 ; callee(0, 0, 0, (void *)0);
17 ; CHECK: DW_TAG_GNU_call_site_parameter
18 ; CHECK-NEXT: DW_AT_location (DW_OP_reg2 RCX)
19 ; CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit0)
21 ; CHECK: DW_TAG_GNU_call_site_parameter
22 ; CHECK-NEXT: DW_AT_location (DW_OP_reg1 RDX)
23 ; CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit0)
25 ; CHECK: DW_TAG_GNU_call_site_parameter
26 ; CHECK-NEXT: DW_AT_location (DW_OP_reg4 RSI)
27 ; CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit0)
29 ; CHECK: DW_TAG_GNU_call_site_parameter
30 ; CHECK-NEXT: DW_AT_location (DW_OP_reg5 RDI)
31 ; CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit0)
33 ; Function Attrs: nounwind uwtable
34 define i32 @caller() #0 !dbg !15 {
36 tail call void @callee(i8 zeroext 0, i16 zeroext 0, i32 0, i8* null), !dbg !19
40 declare !dbg !5 void @callee(i8 zeroext, i16 zeroext, i32, i8*)
42 attributes #0 = { nounwind uwtable }
45 !llvm.module.flags = !{!11, !12, !13}
48 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)
49 !1 = !DIFile(filename: "zero.c", directory: "/")
52 !4 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
53 !5 = !DISubprogram(name: "callee", scope: !1, file: !1, line: 2, type: !6, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
54 !6 = !DISubroutineType(types: !7)
55 !7 = !{null, !8, !9, !10, !4}
56 !8 = !DIBasicType(name: "unsigned char", size: 8, encoding: DW_ATE_unsigned_char)
57 !9 = !DIBasicType(name: "unsigned short", size: 16, encoding: DW_ATE_unsigned)
58 !10 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
59 !11 = !{i32 2, !"Dwarf Version", i32 4}
60 !12 = !{i32 2, !"Debug Info Version", i32 3}
61 !13 = !{i32 1, !"wchar_size", i32 4}
62 !14 = !{!"clang version 10.0.0"}
63 !15 = distinct !DISubprogram(name: "caller", scope: !1, file: !1, line: 3, type: !16, scopeLine: 3, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
64 !16 = !DISubroutineType(types: !17)
66 !18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
67 !19 = !DILocation(line: 4, scope: !15)
68 !20 = !DILocation(line: 5, scope: !15)