1 ; RUN: llc -split-dwarf-file=test.dwo -dwarf-version=4 %s -mtriple=i386-unknown-linux-gnu -filetype=obj -o - | \
2 ; RUN: llvm-dwarfdump -v - | FileCheck %s -check-prefix=DWARF4
4 ; RUN: llc -split-dwarf-file=test.dwo -dwarf-version=5 %s -mtriple=i386-unknown-linux-gnu -filetype=obj -o - | \
5 ; RUN: llvm-dwarfdump -v - | FileCheck %s -check-prefix=DWARF5
14 ; DWARF4: .debug_info contents:
15 ; DWARF4: Compile Unit:{{.*}}version = 0x0004
16 ; DWARF4-NOT: Compile Unit
17 ; DWARF4: DW_TAG_compile_unit
18 ; DWARF4-NOT: DW_TAG_{{.*}}
19 ; DWARF4: DW_AT_GNU_dwo_name{{.*}}test.dwo
20 ; DWARF4: DW_AT_GNU_addr_base{{.*}}0x00000000
21 ; DWARF4: .debug_addr contents:
22 ; DWARF4-NEXT: 0x00000000: Addr Section: length = 0x00000000, version = 0x0004, addr_size = 0x04, seg_size = 0x00
23 ; DWARF4-NEXT: Addrs: [
24 ; DWARF4-NEXT: 0x00000000
25 ; DWARF4-NEXT: 0x00000010
28 ; DWARF5: .debug_info contents:
29 ; DWARF5: Compile Unit:{{.*}}version = 0x0005
30 ; DWARF5-NOT: Compile Unit
31 ; DWARF5: DW_TAG_compile_unit
32 ; DWARF5-NOT: DW_TAG_{{.*}}
33 ; DWARF5: DW_AT_GNU_dwo_name{{.*}}test.dwo
34 ; DWARF5: DW_AT_addr_base{{.*}}0x00000008
35 ; DWARF5: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000000 ".text")
36 ; DWARF5: .debug_addr contents:
37 ; DWARF5-NEXT: 0x00000000: Addr Section: length = 0x0000000c, version = 0x0005, addr_size = 0x04, seg_size = 0x00
38 ; DWARF5-NEXT: Addrs: [
39 ; DWARF5-NEXT: 0x00000000
40 ; DWARF5-NEXT: 0x00000010
43 ; ModuleID = './test.c'
44 source_filename = "./test.c"
45 target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
46 target triple = "i386-unknown-linux-gnu"
48 ; Function Attrs: noinline nounwind optnone
49 define void @foo() #0 !dbg !8 {
54 ; Function Attrs: noinline nounwind optnone
55 define void @bar() #0 !dbg !13 {
60 attributes #0 = { noinline nounwind optnone }
63 !llvm.module.flags = !{!3, !4, !5, !6}
66 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
67 !1 = !DIFile(filename: "test.c", directory: "/tmp")
69 !3 = !{i32 1, !"NumRegisterParameters", i32 0}
70 !4 = !{i32 2, !"Dwarf Version", i32 5}
71 !5 = !{i32 2, !"Debug Info Version", i32 3}
72 !6 = !{i32 1, !"wchar_size", i32 4}
73 !7 = !{!"clang version 6.0.1"}
74 !8 = distinct !DISubprogram(name: "foo", scope: !9, file: !9, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0)
75 !9 = !DIFile(filename: "./test.c", directory: "/tmp")
76 !10 = !DISubroutineType(types: !11)
78 !12 = !DILocation(line: 2, column: 3, scope: !8)
79 !13 = distinct !DISubprogram(name: "bar", scope: !9, file: !9, line: 5, type: !10, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !0)
80 !14 = !DILocation(line: 6, column: 3, scope: !13)