File tree Expand file tree Collapse file tree 3 files changed +39
-29
lines changed Expand file tree Collapse file tree 3 files changed +39
-29
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # REQUIRES: shell
2
+ # RUN: rm -rf %t.dir
3
+ # RUN: mkdir -p %t.dir
4
+ # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.dir/foo.o %s
5
+ # RUN: wasm-ld --reproduce=%t.dir/repro.tar -o %t.dir/out.wasm %t.dir/foo.o
6
+ # RUN: env LLD_REPRODUCE=%t.dir/repro2.tar wasm-ld -o %t.dir/out.wasm %t.dir/foo.o
7
+
8
+ # RUN: cd %t.dir
9
+ # RUN: tar tf repro.tar | FileCheck --check-prefix=TAR %s
10
+ # RUN: tar tf repro2.tar | FileCheck --check-prefix=TAR2 %s
11
+
12
+ # TAR: repro/response.txt
13
+ # TAR: repro/version.txt
14
+ # TAR: repro/{{.*}}/foo.o
15
+
16
+ # TAR2: repro2/response.txt
17
+ # TAR2: repro2/version.txt
18
+ # TAR2: repro2/{{.*}}/foo.o
19
+
20
+ # RUN: tar xf repro.tar
21
+ # RUN: FileCheck --check-prefix=RSP %s < repro/response.txt
22
+
23
+ # RSP: -o {{.*}}out.wasm
24
+ # RSP: {{.*}}/foo.o
25
+
26
+ # RUN: FileCheck %s --check-prefix=VERSION < repro/version.txt
27
+ # VERSION: LLD
28
+
29
+ .globl _start
30
+ _start:
31
+ .functype _start () -> ()
32
+ end_function
Original file line number Diff line number Diff line change @@ -618,6 +618,12 @@ static void checkOptions(opt::InputArgList &args) {
618
618
}
619
619
}
620
620
621
+ static const char *getReproduceOption (opt::InputArgList &args) {
622
+ if (auto *arg = args.getLastArg (OPT_reproduce))
623
+ return arg->getValue ();
624
+ return getenv (" LLD_REPRODUCE" );
625
+ }
626
+
621
627
// Force Sym to be entered in the output. Used for -u or equivalent.
622
628
static Symbol *handleUndefined (StringRef name) {
623
629
Symbol *sym = symtab->find (name);
@@ -955,8 +961,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
955
961
}
956
962
957
963
// Handle --reproduce
958
- if (auto *arg = args.getLastArg (OPT_reproduce)) {
959
- StringRef path = arg->getValue ();
964
+ if (const char *path = getReproduceOption (args)) {
960
965
Expected<std::unique_ptr<TarWriter>> errOrWriter =
961
966
TarWriter::create (path, path::stem (path));
962
967
if (errOrWriter) {
You can’t perform that action at this time.
0 commit comments