xref: /llvm-project/lld/test/wasm/lto/thinlto-prefix-replace.ll (revision b70eb8631386bbccca5a07bb0253aa738d4cda81)
1; Copied from ELF/lto/thinlto-prefix-replace.ll
2; Check that changing the output path via thinlto-prefix-replace works
3; RUN: mkdir -p %t/oldpath
4; RUN: opt -module-summary %s -o %t/oldpath/thinlto_prefix_replace.o
5
6; Ensure that there is no existing file at the new path, so we properly
7; test the creation of the new file there.
8; RUN: rm -f %t/newpath/thinlto_prefix_replace.o.thinlto.bc
9; RUN: wasm-ld --thinlto-index-only --thinlto-prefix-replace="%t/oldpath/;%t/newpath/" -shared %t/oldpath/thinlto_prefix_replace.o -o %t/thinlto_prefix_replace
10; RUN: ls %t/newpath/thinlto_prefix_replace.o.thinlto.bc
11
12; Ensure that lld generates error if prefix replace option does not have 'old;new' format.
13; RUN: rm -f %t/newpath/thinlto_prefix_replace.o.thinlto.bc
14; RUN: not wasm-ld --thinlto-index-only --thinlto-prefix-replace=abc:def -shared %t/oldpath/thinlto_prefix_replace.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR
15; ERR: --thinlto-prefix-replace= expects 'old;new' format, but got abc:def
16
17target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"
18target triple = "wasm32-unknown-unknown"
19
20define void @f() {
21entry:
22  ret void
23}
24