Skip to content

Commit ae56b57

Browse files
committed
[compiler-rt] Fix some tests to work with lit internal shell.
This is part of our work to migrate lit tests to use internal shell by default (performance improvements).
1 parent d5f8578 commit ae56b57

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

compiler-rt/test/fuzzer/fork-sigusr.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Check that libFuzzer honors SIGUSR1/SIGUSR2
22
# Disabled on Windows which does not have SIGUSR1/SIGUSR2.
3-
REQUIRES: shell
43
UNSUPPORTED: darwin, target={{.*windows.*}}, target=aarch64{{.*}}
54
RUN: rm -rf %t
65
RUN: mkdir -p %t
76
RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/ForkSIGUSR
87

9-
RUN: %run %t/ForkSIGUSR -fork=3 -ignore_crashes=1 2>%t/log & export PID=$!
8+
RUN: bash -c "nohup %run %t/ForkSIGUSR -fork=3 -ignore_crashes=1 2>%t/log &" | env
9+
RUN: ps auxx | grep ForkSIGUSR | grep -v "grep" | awk '{print $2}' | tr -d '\n' > %t2
1010
RUN: sleep 3
11-
RUN: kill -SIGUSR2 $PID
11+
RUN: kill -SIGUSR2 %{readfile:%t2}
1212
RUN: sleep 6
1313
RUN: cat %t/log | FileCheck %s --dump-input=fail
1414

compiler-rt/test/fuzzer/sigint.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
REQUIRES: shell, msan
1+
REQUIRES: msan
22
UNSUPPORTED: target=arm{{.*}}
33

44
# Check that libFuzzer exits gracefully under SIGINT with MSan.
55
RUN: rm -rf %t
66
RUN: mkdir -p %t
77
RUN: %msan_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGINT
88

9-
RUN: %run %t/LFSIGINT 2> %t/log & export PID=$!
9+
RUN: bash -c "nohup %run %t/LFSIGINT 2> %t/log &" | env
10+
RUN: ps auxx | grep LFSIGINT | grep -v "grep" | awk '{print $2}' | tr -d '\n' > %t2
1011
RUN: sleep 2
11-
RUN: kill -SIGINT $PID
12+
RUN: kill -SIGINT %{readfile:%t2}
1213
RUN: sleep 3
1314
RUN: cat %t/log | FileCheck %s
1415

compiler-rt/test/fuzzer/sigusr.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# FIXME: Disabled on Windows for now because of reliance on posix only features
22
# (eg: export, "&", pkill).
3-
REQUIRES: shell
43
UNSUPPORTED: darwin, target={{.*windows.*}}
54
# Check that libFuzzer honors SIGUSR1/SIGUSR2
65
RUN: rm -rf %t
76
RUN: mkdir -p %t
87
RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGUSR
98

10-
RUN: %run %t/LFSIGUSR 2> %t/log & export PID=$!
9+
RUN: bash -c "nohup %run %t/LFSIGUSR 2> %t/log &"| env
10+
RUN: ps auxx | grep LFSIGUSR | grep -v "grep" | awk '{print $2}' | tr -d '\n' > %t2
1111
RUN: sleep 2
12-
RUN: kill -SIGUSR1 $PID
12+
RUN: kill -SIGUSR1 %{readfile:%t2}
1313
RUN: sleep 3
1414
RUN: cat %t/log | FileCheck %s
1515

compiler-rt/test/msan/allocator_mapping.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// mapping the heap early, in __msan_init.
44
//
55
// RUN: %clangxx_msan -O0 %s -o %t_1
6-
// RUN: %clangxx_msan -O0 -DHEAP_ADDRESS=$(%run %t_1) %s -o %t_2 && %run %t_2
6+
// RUN: %run %t_1 > %t_3
7+
// RUN: %clangxx_msan -O0 -DHEAP_ADDRESS=%{readfile:%t_3} %s -o %t_2 && %run %t_2
78
//
89
// This test only makes sense for the 64-bit allocator. The 32-bit allocator
910
// does not have a fixed mapping. Exclude platforms that use the 32-bit

compiler-rt/test/nsan/Posix/allocator_mapping.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
/// Test that a module constructor can not map memory over the NSan heap
33
/// (without MAP_FIXED, of course).
44
// RUN: %clangxx_nsan -O0 %s -o %t_1
5-
// RUN: %clangxx_nsan -O0 -DHEAP_ADDRESS=$(%run %t_1) %s -o %t_2 && %run %t_2
5+
// RUN: %run %t_1 > %t_3
6+
// RUN: %clangxx_nsan -O0 -DHEAP_ADDRESS=%{readfile:%t_3} %s -o %t_2 && %run %t_2
67

78
#include <assert.h>
89
#include <stdio.h>

compiler-rt/test/tsan/ignore_lib0.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
// RUN: %clangxx_tsan -O1 -fno-builtin %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib0.so
55
// RUN: %clangxx_tsan -O1 %s -L%t-dir -lignore_lib0 %link_libcxx_tsan -o %t
66
// RUN: echo running w/o suppressions:
7-
// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
7+
// RUN: bash -c env | grep LD_LIBRARY_PATH | sed s/.*LD_LIBRARY_PATH=// > %t2
8+
// RUN: env LD_LIBRARY_PATH=%t-dir:%{readfile:%t2} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
89
// RUN: echo running with suppressions:
9-
// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
10+
// RUN: env LD_LIBRARY_PATH=%t-dir:%{readfile:%t2} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
1011
// RUN: echo running with generic suppression of noninstrumented code:
11-
// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=ignore_noninstrumented_modules=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
12+
// RUN: env LD_LIBRARY_PATH=%t-dir:%{readfile:%t2} %env_tsan_opts=ignore_noninstrumented_modules=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
1213

1314
// Tests that interceptors coming from a library specified in called_from_lib
1415
// suppression are ignored.
@@ -37,4 +38,3 @@ int main() {
3738

3839
// CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race
3940
// CHECK-WITHSUPP: OK
40-

0 commit comments

Comments
 (0)