xref: /llvm-project/llvm/test/DebugInfo/X86/debug-aranges-dwarf64.ll (revision b118030f3fa68b308d149d7d4303e0623ead0463)
1*b118030fSIgor Kudrin; This checks that .debug_aranges can be generated in the DWARF64 format.
2*b118030fSIgor Kudrin
3*b118030fSIgor Kudrin; RUN: llc -mtriple=x86_64 -dwarf64 -generate-arange-section -filetype=obj %s -o %t
4*b118030fSIgor Kudrin; RUN: llvm-dwarfdump -debug-aranges %t | FileCheck %s
5*b118030fSIgor Kudrin
6*b118030fSIgor Kudrin; CHECK:      .debug_aranges contents:
7*b118030fSIgor Kudrin; CHECK-NEXT: Address Range Header:
8*b118030fSIgor Kudrin; CHECK-SAME:   length = 0x0000000000000034,
9*b118030fSIgor Kudrin; CHECK-SAME:   format = DWARF64,
10*b118030fSIgor Kudrin; CHECK-SAME:   version = 0x0002,
11*b118030fSIgor Kudrin; CHECK-SAME:   cu_offset = 0x0000000000000000,
12*b118030fSIgor Kudrin; CHECK-SAME:   addr_size = 0x08,
13*b118030fSIgor Kudrin; CHECK-SAME:   seg_size = 0x00
14*b118030fSIgor Kudrin; CHECK-NEXT: [0x0000000000000000,  0x0000000000000004)
15*b118030fSIgor Kudrin
16*b118030fSIgor Kudrin; IR generated and reduced from:
17*b118030fSIgor Kudrin; $ cat foo.c
18*b118030fSIgor Kudrin; int foo;
19*b118030fSIgor Kudrin; $ clang -g -S -emit-llvm foo.c -o foo.ll
20*b118030fSIgor Kudrin
21*b118030fSIgor Kudrintarget triple = "x86_64-unknown-linux-gnu"
22*b118030fSIgor Kudrin
23*b118030fSIgor Kudrin@foo = dso_local global i32 0, align 4, !dbg !0
24*b118030fSIgor Kudrin
25*b118030fSIgor Kudrin!llvm.dbg.cu = !{!2}
26*b118030fSIgor Kudrin!llvm.module.flags = !{!7, !8, !9}
27*b118030fSIgor Kudrin!llvm.ident = !{!10}
28*b118030fSIgor Kudrin
29*b118030fSIgor Kudrin!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
30*b118030fSIgor Kudrin!1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
31*b118030fSIgor Kudrin!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 12.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
32*b118030fSIgor Kudrin!3 = !DIFile(filename: "foo.c", directory: "/tmp")
33*b118030fSIgor Kudrin!4 = !{}
34*b118030fSIgor Kudrin!5 = !{!0}
35*b118030fSIgor Kudrin!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
36*b118030fSIgor Kudrin!7 = !{i32 7, !"Dwarf Version", i32 4}
37*b118030fSIgor Kudrin!8 = !{i32 2, !"Debug Info Version", i32 3}
38*b118030fSIgor Kudrin!9 = !{i32 1, !"wchar_size", i32 4}
39*b118030fSIgor Kudrin!10 = !{!"clang version 12.0.0"}
40