summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-10-19 14:30:44 +0000
committerTeresa Johnson <tejohnson@google.com>2015-10-19 14:30:44 +0000
commit91a88bba0ee55edb50d9f3b396da90bc8a917627 (patch)
tree38d976459bf1586cf20b39c9aef2ab549914fa6d /llvm/test/tools
parent335332329be2df4fe9808d4635de73690e191f1f (diff)
downloadbcm5719-llvm-91a88bba0ee55edb50d9f3b396da90bc8a917627.tar.gz
bcm5719-llvm-91a88bba0ee55edb50d9f3b396da90bc8a917627.zip
llvm-lto support for generating combined function indexes
Summary: This patch adds support to llvm-lto that mirrors the support added by r249270 to the gold plugin. This enables better testing of combined index generation for ThinLTO. Added a new test, and this support will be used in the test in D13515. Reviewers: joker.eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13847 llvm-svn: 250699
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/llvm-lto/Inputs/thinlto.ll4
-rw-r--r--llvm/test/tools/llvm-lto/thinlto.ll24
2 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-lto/Inputs/thinlto.ll b/llvm/test/tools/llvm-lto/Inputs/thinlto.ll
new file mode 100644
index 00000000000..4e0840f3691
--- /dev/null
+++ b/llvm/test/tools/llvm-lto/Inputs/thinlto.ll
@@ -0,0 +1,4 @@
+define void @g() {
+entry:
+ ret void
+}
diff --git a/llvm/test/tools/llvm-lto/thinlto.ll b/llvm/test/tools/llvm-lto/thinlto.ll
new file mode 100644
index 00000000000..29d3881b9df
--- /dev/null
+++ b/llvm/test/tools/llvm-lto/thinlto.ll
@@ -0,0 +1,24 @@
+; Test combined function index generation for ThinLTO via llvm-lto.
+; RUN: llvm-as -function-summary %s -o %t.o
+; RUN: llvm-as -function-summary %p/Inputs/thinlto.ll -o %t2.o
+; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
+; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
+; RUN: not test -e %t3
+
+; COMBINED: <MODULE_STRTAB_BLOCK
+; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}/thinlto.ll.tmp{{.*}}.o'
+; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}/thinlto.ll.tmp{{.*}}.o'
+; COMBINED-NEXT: </MODULE_STRTAB_BLOCK
+; COMBINED-NEXT: <FUNCTION_SUMMARY_BLOCK
+; COMBINED-NEXT: <COMBINED_ENTRY
+; COMBINED-NEXT: <COMBINED_ENTRY
+; COMBINED-NEXT: </FUNCTION_SUMMARY_BLOCK
+; COMBINED-NEXT: <VALUE_SYMTAB
+; COMBINED-NEXT: <COMBINED_FNENTRY {{.*}} record string = '{{f|g}}'
+; COMBINED-NEXT: <COMBINED_FNENTRY {{.*}} record string = '{{f|g}}'
+; COMBINED-NEXT: </VALUE_SYMTAB
+
+define void @f() {
+entry:
+ ret void
+}
OpenPOWER on IntegriCloud