xref: /aosp_15_r20/external/llvm/test/ThinLTO/X86/prefix_replace.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Check that changing the output path via prefix-replace works
2*9880d681SAndroid Build Coastguard Worker; Use of '/' in paths created here make this unsuitable for Windows.
3*9880d681SAndroid Build Coastguard Worker; RUN: mkdir -p %T/oldpath
4*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %s -o %T/oldpath/prefix_replace.o
5*9880d681SAndroid Build Coastguard Worker; Ensure that there is no existing file at the new path, so we properly
6*9880d681SAndroid Build Coastguard Worker; test the creation of the new file there.
7*9880d681SAndroid Build Coastguard Worker; RUN: rm -f %T/newpath/prefix_replace.o.thinlto.bc
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %T/oldpath/prefix_replace.o
10*9880d681SAndroid Build Coastguard Worker; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-prefix-replace="%T/oldpath/;%T/newpath/" -thinlto-index %t.index.bc %T/oldpath/prefix_replace.o
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; RUN: ls %T/newpath/prefix_replace.o.thinlto.bc
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @f() {
15*9880d681SAndroid Build Coastguard Workerentry:
16*9880d681SAndroid Build Coastguard Worker  ret void
17*9880d681SAndroid Build Coastguard Worker}
18