1 ; RUN: llc -dwarf-version=5 -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
2 ; RUN: llvm-dwarfdump -v %t | FileCheck %s
4 ; Check that we generate DW_AT_rnglists_base in the CU die, as well as a range
5 ; list table when we have more than 1 CU range and no scope range.
9 ; __attribute__((section("text.foo"))) void f1() {}
10 ; __attribute__((section("text.bar"))) void f2() {}
12 ; Compile with clangc -gdwarf-5 -O0 -S -emit-llvm
14 ; CHECK: .debug_info contents:
15 ; CHECK: DW_TAG_compile_unit
17 ; CHECK: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)
18 ; CHECK: .debug_rnglists contents:
19 ; CHECK: 0x00000000: range list header: length = 0x00000013, version = 0x0005,
20 ; CHECK-SAME: addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
22 ; Function Attrs: noinline nounwind optnone uwtable
23 define dso_local void @f1() section "text.foo" !dbg !7 {
28 ; Function Attrs: noinline nounwind optnone uwtable
29 define dso_local void @f2() section "text.bar" !dbg !11 {
35 !llvm.module.flags = !{!3, !4, !5}
38 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 7.0.0 (trunk 337470)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
39 !1 = !DIFile(filename: "test3.c", directory: "/home/test/rangelists", checksumkind: CSK_MD5, checksum: "f3b46bc2e5bc55bdd511ae4ec29577b6")
41 !3 = !{i32 2, !"Dwarf Version", i32 5}
42 !4 = !{i32 2, !"Debug Info Version", i32 3}
43 !5 = !{i32 1, !"wchar_size", i32 4}
44 !6 = !{!"clang version 7.0.0 (trunk 337470)"}
45 !7 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2)
46 !8 = !DISubroutineType(types: !9)
48 !10 = !DILocation(line: 1, column: 49, scope: !7)
49 !11 = distinct !DISubprogram(name: "f2", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)
50 !12 = !DILocation(line: 2, column: 49, scope: !11)