xref: /llvm-project/llvm/test/DebugInfo/X86/dbgcall-site-64-bit-imms.ll (revision d9b962100942c71a4c26debaa716f7ab0c4ea8a1)
1; RUN: llc -emit-call-site-info -O1 -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
2
3; Verify that the 64-bit call site immediates are not truncated.
4;
5; Reproducer for PR43525.
6
7; Based on the following C program:
8;
9; #include <stdint.h>
10;
11; extern void foo(int64_t);
12;
13; int main() {
14;   foo(INT64_C(0x1122334455667788));
15;   foo(INT32_C(-100));
16; }
17
18; CHECK: DW_AT_GNU_call_site_value (DW_OP_constu 0x1122334455667788)
19; CHECK: DW_AT_GNU_call_site_value (DW_OP_constu 0xffffffffffffff9c)
20
21target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22target triple = "x86_64-unknown-linux-gnu"
23
24; Function Attrs: nounwind uwtable
25define i32 @main() !dbg !12 {
26entry:
27  tail call void @foo(i64 1234605616436508552), !dbg !16
28  tail call void @foo(i64 -100), !dbg !17
29  ret i32 0, !dbg !18
30}
31
32declare !dbg !4 void @foo(i64)
33
34!llvm.dbg.cu = !{!0}
35!llvm.module.flags = !{!8, !9, !10}
36!llvm.ident = !{!11}
37
38!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)
39!1 = !DIFile(filename: "dbgcall-site-long-imms.c", directory: "/")
40!2 = !{}
41!3 = !{!4}
42!4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
43!5 = !DISubroutineType(types: !6)
44!6 = !{null, !7}
45!7 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
46!8 = !{i32 2, !"Dwarf Version", i32 4}
47!9 = !{i32 2, !"Debug Info Version", i32 3}
48!10 = !{i32 1, !"wchar_size", i32 4}
49!11 = !{!"clang version 10.0.0"}
50!12 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 5, type: !13, scopeLine: 5, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
51!13 = !DISubroutineType(types: !14)
52!14 = !{!15}
53!15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
54!16 = !DILocation(line: 6, scope: !12)
55!17 = !DILocation(line: 7, scope: !12)
56!18 = !DILocation(line: 8, scope: !12)
57