xref: /llvm-project/lld/test/COFF/thinlto-prefix-replace.ll (revision 7b1d793713cf9ed9ab719f33b332f9c66a1fc5cc)
15011b832SBob Haarman; REQUIRES: x86
25011b832SBob Haarman; Check that changing the output path via thinlto-prefix-replace works
35011b832SBob Haarman; RUN: mkdir -p %t/oldpath
45011b832SBob Haarman; RUN: opt -module-summary %s -o %t/oldpath/t.obj
55011b832SBob Haarman
65011b832SBob Haarman; Ensure that there is no existing file at the new path, so we properly
75011b832SBob Haarman; test the creation of the new file there.
85011b832SBob Haarman; RUN: rm -f %t/newpath/t.obj.thinlto.bc
95011b832SBob Haarman; RUN: lld-link -entry:main -thinlto-index-only \
105011b832SBob Haarman; RUN:     -thinlto-prefix-replace:"%t/oldpath/;%t/newpath/" %t/oldpath/t.obj \
115011b832SBob Haarman; RUN:     -out:%t/t.exe
125011b832SBob Haarman; RUN: ls %t/newpath/t.obj.thinlto.bc
135011b832SBob Haarman
145011b832SBob Haarman; Ensure that lld errors if prefix replace option is not in 'old;new' format.
155011b832SBob Haarman; RUN: rm -f %t/newpath/t.obj.thinlto.bc
165011b832SBob Haarman; RUN: not lld-link -entry:main -thinlto-index-only \
175011b832SBob Haarman; RUN:     -thinlto-prefix-replace:"abc:def" %t/oldpath/t.obj \
185011b832SBob Haarman; RUN:     -out:%t/t.exe 2>&1 | FileCheck --check-prefix=ERR %s
195011b832SBob Haarman; ERR: -thinlto-prefix-replace: expects 'old;new' format, but got abc:def
205011b832SBob Haarman
21*7b1d7937SAmy Huangtarget datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
225011b832SBob Haarmantarget triple = "x86_64-pc-windows-msvc19.0.24215"
235011b832SBob Haarman
245011b832SBob Haarmandefine void @main() {
255011b832SBob Haarman  ret void
265011b832SBob Haarman}
27