summaryrefslogtreecommitdiffstats
path: root/llvm/test/ThinLTO/X86
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/ThinLTO/X86')
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/llvm.used.ll11
-rw-r--r--llvm/test/ThinLTO/X86/llvm.used.ll25
2 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/ThinLTO/X86/Inputs/llvm.used.ll b/llvm/test/ThinLTO/X86/Inputs/llvm.used.ll
new file mode 100644
index 00000000000..35f5529c2b6
--- /dev/null
+++ b/llvm/test/ThinLTO/X86/Inputs/llvm.used.ll
@@ -0,0 +1,11 @@
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.11.0"
+
+
+define i32 @main() #0 {
+entry:
+ call void (...) @globalfunc()
+ ret i32 0
+}
+
+declare void @globalfunc(...) \ No newline at end of file
diff --git a/llvm/test/ThinLTO/X86/llvm.used.ll b/llvm/test/ThinLTO/X86/llvm.used.ll
new file mode 100644
index 00000000000..4b379f72c25
--- /dev/null
+++ b/llvm/test/ThinLTO/X86/llvm.used.ll
@@ -0,0 +1,25 @@
+; Do setup work for all below tests: generate bitcode and combined index
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/llvm.used.ll -o %t2.bc
+; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
+
+
+; RUN: llvm-lto -thinlto-action=import %t2.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s
+; CHECK: define available_externally void @globalfunc
+
+
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.11.0"
+
+
+
+define internal void @_ZN12_GLOBAL__N_16Module4dumpEv() {
+ ret void
+}
+@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ZN12_GLOBAL__N_16Module4dumpEv to i8*)], section "llvm.metadata"
+
+
+define void @globalfunc() #0 {
+entry:
+ ret void
+}
OpenPOWER on IntegriCloud