summaryrefslogtreecommitdiff
path: root/test/ThinLTO
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-08-13 23:31:53 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-08-13 23:31:53 +0000
commitc5432bdac59045fae393f01258ec6972c539904d (patch)
tree2124e5f9b12a9489cc73668f185699da3d94e073 /test/ThinLTO
parent804c815e77fbfc918cfbe28f94d8aa4cef8bfcbd (diff)
downloadllvm-c5432bdac59045fae393f01258ec6972c539904d.tar.gz
Fix bitcode auto-upgrade when using bitcode lazy loading
The auto-upgrade path could be called before the VST (global names) was fully parsed, and thus intrinsic names were not available and the autoupgrade logic could not operate. Fix link failures with ThinLTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ThinLTO')
-rw-r--r--test/ThinLTO/X86/Inputs/autoupgrade.bcbin0 -> 1024 bytes
-rw-r--r--test/ThinLTO/X86/autoupgrade.ll23
2 files changed, 23 insertions, 0 deletions
diff --git a/test/ThinLTO/X86/Inputs/autoupgrade.bc b/test/ThinLTO/X86/Inputs/autoupgrade.bc
new file mode 100644
index 000000000000..578b33796fa3
--- /dev/null
+++ b/test/ThinLTO/X86/Inputs/autoupgrade.bc
Binary files differ
diff --git a/test/ThinLTO/X86/autoupgrade.ll b/test/ThinLTO/X86/autoupgrade.ll
new file mode 100644
index 000000000000..fd7111480f03
--- /dev/null
+++ b/test/ThinLTO/X86/autoupgrade.ll
@@ -0,0 +1,23 @@
+; Verify that auto-upgrading intrinsics works with Lazy loaded bitcode
+; Do setup work for all below tests: generate bitcode and combined index
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %p/Inputs/autoupgrade.bc
+
+; RUN: llvm-lto -thinlto-action=import %t.bc -thinlto-index=%t3.bc -o - | llvm-bcanalyzer -dump | FileCheck %s
+
+; We can't use llvm-dis here, because it would do the autoupgrade itself.
+
+; CHECK-NOT: 'llvm.invariant.start'
+; CHECK: record string = 'llvm.invariant.start.p0i8'
+; CHECK-NOT: 'llvm.invariant.start'
+
+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 (...) @globalfunc1()
+ ret i32 0
+}
+
+declare void @globalfunc1(...) #1