aboutsummaryrefslogtreecommitdiff
path: root/test/ThinLTO/X86/prefix_replace.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/ThinLTO/X86/prefix_replace.ll')
-rw-r--r--test/ThinLTO/X86/prefix_replace.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ThinLTO/X86/prefix_replace.ll b/test/ThinLTO/X86/prefix_replace.ll
new file mode 100644
index 000000000000..c2c125c2f1c0
--- /dev/null
+++ b/test/ThinLTO/X86/prefix_replace.ll
@@ -0,0 +1,17 @@
+; Check that changing the output path via prefix-replace works
+; Use of '/' in paths created here make this unsuitable for Windows.
+; RUN: mkdir -p %T/oldpath
+; RUN: opt -module-summary %s -o %T/oldpath/prefix_replace.o
+; Ensure that there is no existing file at the new path, so we properly
+; test the creation of the new file there.
+; RUN: rm -f %T/newpath/prefix_replace.o.thinlto.bc
+
+; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %T/oldpath/prefix_replace.o
+; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-prefix-replace="%T/oldpath/;%T/newpath/" -thinlto-index %t.index.bc %T/oldpath/prefix_replace.o
+
+; RUN: ls %T/newpath/prefix_replace.o.thinlto.bc
+
+define void @f() {
+entry:
+ ret void
+}