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