summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker/Inputs/only-needed-debug-metadata.ll
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-12-18 17:51:37 +0000
committerTeresa Johnson <tejohnson@google.com>2015-12-18 17:51:37 +0000
commit0e7c82cb69972c75978ec6c5077cc91879836122 (patch)
treecb53c4e32ca3659066af39599edd05c32ca6b8a4 /llvm/test/Linker/Inputs/only-needed-debug-metadata.ll
parentb9e832608879a9defe8be23384677b9335b00546 (diff)
downloadbcm5719-llvm-0e7c82cb69972c75978ec6c5077cc91879836122.tar.gz
bcm5719-llvm-0e7c82cb69972c75978ec6c5077cc91879836122.zip
[ThinLTO/LTO] Don't link in unneeded metadata
Summary: Third patch split out from http://reviews.llvm.org/D14752. Only map in needed DISubroutine metadata (imported or otherwise linked in functions and other DISubroutine referenced by inlined instructions). This is supported for ThinLTO, LTO and llvm-link --only-needed, with associated tests for each one. Depends on D14838. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14843 llvm-svn: 256003
Diffstat (limited to 'llvm/test/Linker/Inputs/only-needed-debug-metadata.ll')
-rw-r--r--llvm/test/Linker/Inputs/only-needed-debug-metadata.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Linker/Inputs/only-needed-debug-metadata.ll b/llvm/test/Linker/Inputs/only-needed-debug-metadata.ll
new file mode 100644
index 00000000000..ec7f02f4d19
--- /dev/null
+++ b/llvm/test/Linker/Inputs/only-needed-debug-metadata.ll
@@ -0,0 +1,27 @@
+@X = external global i32
+
+declare i32 @foo()
+
+define void @bar() !dbg !4 {
+ load i32, i32* @X, !dbg !10
+ call i32 @foo(), !dbg !11
+ ret void, !dbg !12
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!7, !8}
+!llvm.ident = !{!9}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 251407) (llvm/trunk 251401)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
+!1 = !DIFile(filename: "linkused.b.c", directory: ".")
+!2 = !{}
+!3 = !{!4}
+!4 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: true, variables: !2)
+!5 = !DISubroutineType(types: !6)
+!6 = !{null}
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 2, !"Debug Info Version", i32 3}
+!9 = !{!"clang version 3.8.0 (trunk 251407) (llvm/trunk 251401)"}
+!10 = !DILocation(line: 6, column: 7, scope: !4)
+!11 = !DILocation(line: 6, column: 3, scope: !4)
+!12 = !DILocation(line: 7, column: 1, scope: !4)
OpenPOWER on IntegriCloud