File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
llvm/test/tools/llvm-foreach Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: system-linux
2
+ // Test that the return value from the called tool is retained.
3
+ // Runs a script within a script so we can retain the return code without
4
+ // the testing infrastructure getting in the way.
5
+
6
+ // RUN: echo 'Content of first file' > %t1.tgt
7
+ // RUN: echo 'Content of second file' > %t2.tgt
8
+ // RUN: echo "%t1.tgt" > %t.list
9
+ // RUN: echo "%t2.tgt" >> %t.list
10
+
11
+ // RUN: echo "#!/bin/sh" > %t.sh
12
+ // RUN: echo "cat \$1" >> %t.sh
13
+ // RUN: echo "exit 21" >> %t.sh
14
+ // RUN: chmod 777 %t.sh
15
+ // RUN: echo "#!/bin/sh" > %t2.sh
16
+ // RUN: echo "llvm-foreach --in-replace=\"{}\" --in-file-list=%t.list -- %t.sh \"{}\" > %t.res" >> %t2.sh
17
+ // RUN: echo "echo \$? >> %t.res" >> %t2.sh
18
+ // RUN: chmod 777 %t2.sh
19
+ // RUN: %t2.sh
20
+ // RUN: FileCheck < %t.res %s
21
+ // CHECK: Content of first file
22
+ // CHECK: Content of second file
23
+ // CHECK: 21
You can’t perform that action at this time.
0 commit comments