1 ; RUN: rm -rf %t && mkdir -p %t
2 ; RUN: opt -module-summary %s -o %t/split-dwarf.o
3 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
5 ; RUN: --plugin-opt=thinlto \
6 ; RUN: --plugin-opt=dwo_dir=%t/dwo_dir \
7 ; RUN: %t/split-dwarf.o --shared -o %t/split-dwarf
9 ; RUN: llvm-dwarfdump -debug-info %t/split-dwarf | FileCheck %s
10 ; CHECK: DW_AT_GNU_dwo_name{{.*}}dwo_dir/1.dwo
11 ; CHECK-NOT: DW_TAG_subprogram
12 ; RUN: llvm-dwarfdump -debug-info %t/dwo_dir/1.dwo | FileCheck --check-prefix DWOCHECK %s
13 ; DWOCHECK: DW_AT_name{{.*}}split-dwarf.c
14 ; DWOCHECK: DW_AT_GNU_dwo_name{{.*}}dwo_dir/1.dwo
15 ; DWOCHECK: DW_TAG_subprogram
17 ; RUN:rm -rf %t/dwo_dir
18 ; RUN: opt %s -o %t/split-dwarf.o
19 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
20 ; RUN: -m elf_x86_64 \
21 ; RUN: --plugin-opt=thinlto \
22 ; RUN: --plugin-opt=dwo_dir=%t/dwo_dir \
23 ; RUN: %t/split-dwarf.o --shared -o %t/split-dwarf
25 ; RUN: llvm-dwarfdump -debug-info %t/split-dwarf | FileCheck --check-prefix LTOCHECK %s
26 ; LTOCHECK: DW_AT_GNU_dwo_name{{.*}}dwo_dir/0.dwo
27 ; LTOCHECK-NOT: DW_TAG_subprogram
28 ; RUN: llvm-dwarfdump -debug-info %t/dwo_dir/0.dwo | FileCheck --check-prefix LTODWOCHECK %s
29 ; LTODWOCHECK: DW_AT_name{{.*}}split-dwarf.c
30 ; LTODWOCHECK: DW_AT_GNU_dwo_name{{.*}}dwo_dir/0.dwo
31 ; LTODWOCHECK: DW_TAG_subprogram
33 ; ModuleID = 'split-dwarf.c'
34 source_filename = "split-dwarf.c"
35 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
36 target triple = "x86_64-unknown-linux-gnu"
38 ; Function Attrs: noinline nounwind optnone uwtable
39 define dso_local i32 @split_dwarf() #0 !dbg !7 {
44 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
47 !llvm.module.flags = !{!3, !4, !5}
50 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 7.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
51 !1 = !DIFile(filename: "split-dwarf.c", directory: "/usr/local/google/home/yunlian/dwp/build/bin")
53 !3 = !{i32 2, !"Dwarf Version", i32 4}
54 !4 = !{i32 2, !"Debug Info Version", i32 3}
55 !5 = !{i32 1, !"wchar_size", i32 4}
56 !6 = !{!"clang version 7.0.0"}
57 !7 = distinct !DISubprogram(name: "split_dwarf", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2)
58 !8 = !DISubroutineType(types: !9)
60 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
61 !11 = !DILocation(line: 2, column: 2, scope: !7)