• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
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
6
7; Source:
8; void foo() {
9; }
10;
11; void bar() {
12; }
13
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
26; DWARF4-NEXT: ]
27
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_GNU_addr_base{{.*}}0x00000000
35; DWARF5: .debug_addr contents:
36; DWARF5-NEXT: 0x00000000: Addr Section: length = 0x0000000c, version = 0x0005, addr_size = 0x04, seg_size = 0x00
37; DWARF5-NEXT: Addrs: [
38; DWARF5-NEXT: 0x00000000
39; DWARF5-NEXT: 0x00000010
40; DWARF5-NEXT: ]
41
42; ModuleID = './test.c'
43source_filename = "./test.c"
44target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
45target triple = "i386-unknown-linux-gnu"
46
47; Function Attrs: noinline nounwind optnone
48define void @foo() #0 !dbg !8 {
49entry:
50  ret void, !dbg !12
51}
52
53; Function Attrs: noinline nounwind optnone
54define void @bar() #0 !dbg !13 {
55entry:
56  ret void, !dbg !14
57}
58
59attributes #0 = { noinline nounwind optnone }
60
61!llvm.dbg.cu = !{!0}
62!llvm.module.flags = !{!3, !4, !5, !6}
63!llvm.ident = !{!7}
64
65!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
66!1 = !DIFile(filename: "test.c", directory: "/tmp")
67!2 = !{}
68!3 = !{i32 1, !"NumRegisterParameters", i32 0}
69!4 = !{i32 2, !"Dwarf Version", i32 5}
70!5 = !{i32 2, !"Debug Info Version", i32 3}
71!6 = !{i32 1, !"wchar_size", i32 4}
72!7 = !{!"clang version 6.0.1"}
73!8 = distinct !DISubprogram(name: "foo", scope: !9, file: !9, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0)
74!9 = !DIFile(filename: "./test.c", directory: "/tmp")
75!10 = !DISubroutineType(types: !11)
76!11 = !{null}
77!12 = !DILocation(line: 2, column: 3, scope: !8)
78!13 = distinct !DISubprogram(name: "bar", scope: !9, file: !9, line: 5, type: !10, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !0)
79!14 = !DILocation(line: 6, column: 3, scope: !13)
80