Skip to content

Commit 5b537b1

Browse files
committed
[llvm-lit] Fixing Command not found errors in Compiler-rt
There are several files in compiler-rt that have command not found errors. This patch uses the env command to properly set the environment variables correctly when using the internal shell.
1 parent 898d6eb commit 5b537b1

35 files changed

+80
-82
lines changed

compiler-rt/test/dfsan/custom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clang_dfsan %s -o %t && DFSAN_OPTIONS="strict_data_dependencies=0" %run %t
1+
// RUN: %clang_dfsan %s -o %t && env DFSAN_OPTIONS="strict_data_dependencies=0" %run %t
22
// RUN: %clang_dfsan -DSTRICT_DATA_DEPENDENCIES %s -o %t && %run %t
33
// RUN: %clang_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 -mllvm -dfsan-combine-pointer-labels-on-load=false -DSTRICT_DATA_DEPENDENCIES %s -o %t && %run %t
4-
// RUN: %clang_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 -mllvm -dfsan-combine-pointer-labels-on-load=false -no-pie %s -o %t && DFSAN_OPTIONS="strict_data_dependencies=0" %run %t
4+
// RUN: %clang_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 -mllvm -dfsan-combine-pointer-labels-on-load=false -no-pie %s -o %t && env DFSAN_OPTIONS="strict_data_dependencies=0" %run %t
55
//
66
// Tests custom implementations of various glibc functions.
77

compiler-rt/test/dfsan/flags.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_unimplemented=1 %run %t 2>&1 | FileCheck %s
2-
// RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_unimplemented=0 %run %t 2>&1 | count 0
3-
// RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_nonzero_labels=1 %run %t 2>&1 | FileCheck --check-prefix=CHECK-NONZERO %s
1+
// RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && env DFSAN_OPTIONS=warn_unimplemented=1 %run %t 2>&1 | FileCheck %s
2+
// RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && env DFSAN_OPTIONS=warn_unimplemented=0 %run %t 2>&1 | count 0
3+
// RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && env DFSAN_OPTIONS=warn_nonzero_labels=1 %run %t 2>&1 | FileCheck --check-prefix=CHECK-NONZERO %s
44

55
// Tests that flags work correctly.
66

compiler-rt/test/dfsan/fork.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: %run %t 2>&1 | FileCheck %s
77
//
88
// RUN: %clangxx_dfsan -mllvm -dfsan-track-origins=1 %s -o %t
9-
// RUN: DFSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t 2>&1 | FileCheck %s
9+
// RUN: env DFSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t 2>&1 | FileCheck %s
1010

1111
#include <assert.h>
1212
#include <errno.h>

compiler-rt/test/dfsan/origin_limit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// RUN: %run %t >%t.out 2>&1
44
// RUN: FileCheck %s < %t.out
55
//
6-
// RUN: DFSAN_OPTIONS=origin_history_size=2 %run %t >%t.out 2>&1
6+
// RUN: env DFSAN_OPTIONS=origin_history_size=2 %run %t >%t.out 2>&1
77
// RUN: FileCheck %s --check-prefix=CHECK2 < %t.out
88
//
9-
// RUN: DFSAN_OPTIONS=origin_history_size=0 %run %t >%t.out 2>&1
9+
// RUN: env DFSAN_OPTIONS=origin_history_size=0 %run %t >%t.out 2>&1
1010
// RUN: FileCheck %s --check-prefix=CHECK0 < %t.out
1111

1212
#include <sanitizer/dfsan_interface.h>

compiler-rt/test/msan/Linux/sendmsg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
// RUN: %clangxx_msan %s -DSENDMMSG -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
1010

1111
// RUN: %clangxx_msan %s -DSEND -DPOISON -o %t && \
12-
// RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
12+
// RUN: env MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
1313
// RUN: %clangxx_msan %s -DSENDTO -DPOISON -o %t && \
14-
// RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
14+
// RUN: env MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
1515
// RUN: %clangxx_msan %s -DSENDMSG -DPOISON -o %t && \
16-
// RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
16+
// RUN: env MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
1717
// RUN: %clangxx_msan %s -DSENDMMSG -DPOISON -o %t && \
18-
// RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
18+
// RUN: env MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE
1919

2020
// UNSUPPORTED: android
2121

compiler-rt/test/msan/chained_origin_empty_stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -O3 %s -o %t && \
2-
// RUN: MSAN_OPTIONS=store_context_size=1 not %run %t 2>&1 | FileCheck %s
2+
// RUN: env MSAN_OPTIONS=store_context_size=1 not %run %t 2>&1 | FileCheck %s
33

44
// Test that stack trace for the intermediate store is not empty.
55

compiler-rt/test/msan/chained_origin_limits.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,61 @@
33
// Heap origin.
44
// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t
55

6-
// RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
6+
// RUN: env MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
77
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
88

9-
// RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
9+
// RUN: env MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
1010
// RUN: FileCheck %s --check-prefix=CHECK2 < %t.out
1111

12-
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
12+
// RUN: env MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
1313
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%short-stack < %t.out
1414

15-
// RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
15+
// RUN: env MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
1616
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
1717

1818
// Stack origin.
1919
// RUN: %clangxx_msan -DSTACK -fsanitize-memory-track-origins=2 -O3 %s -o %t
2020

21-
// RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
21+
// RUN: env MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
2222
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
2323

24-
// RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
24+
// RUN: env MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
2525
// RUN: FileCheck %s --check-prefix=CHECK2 < %t.out
2626

27-
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
27+
// RUN: env MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
2828
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%short-stack < %t.out
2929

30-
// RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
30+
// RUN: env MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
3131
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
3232

33-
3433
// Heap origin, with calls.
3534
// RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t
3635

37-
// RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
36+
// RUN: env MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
3837
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
3938

40-
// RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
39+
// RUN: env MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
4140
// RUN: FileCheck %s --check-prefix=CHECK2 < %t.out
4241

43-
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
42+
// RUN: env MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
4443
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%short-stack < %t.out
4544

46-
// RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
45+
// RUN: env MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
4746
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
4847

49-
5048
// Stack origin, with calls.
5149
// RUN: %clangxx_msan -DSTACK -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t
5250

53-
// RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
51+
// RUN: env MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1
5452
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
5553

56-
// RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
54+
// RUN: env MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1
5755
// RUN: FileCheck %s --check-prefix=CHECK2 < %t.out
5856

59-
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
57+
// RUN: env MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
6058
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%short-stack < %t.out
6159

62-
// RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
60+
// RUN: env MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
6361
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
6462

6563
#include <stdio.h>

compiler-rt/test/msan/coverage-levels.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
//
33
// RUN: %clangxx_msan -DINIT_VAR=1 -O1 -fsanitize-coverage=func,trace-pc-guard %s -o %t
44
// RUN: mkdir -p %t-dir
5-
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
5+
// RUN: env MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
66
// RUN: %clangxx_msan -O1 -fsanitize-coverage=func,trace-pc-guard %s -o %t
7-
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
7+
// RUN: env MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
88
// RUN: %clangxx_msan -O1 -fsanitize-coverage=bb,trace-pc-guard %s -o %t
9-
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
9+
// RUN: env MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
1010
// RUN: %clangxx_msan -O1 -fsanitize-coverage=edge,trace-pc-guard %s -o %t
11-
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
11+
// RUN: env MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%t-dir not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
1212

1313
volatile int sink;
1414
int main(int argc, char **argv) {

compiler-rt/test/msan/dtor-member.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// RUN: %clangxx_msan %s -fsanitize=memory -fno-sanitize-memory-use-after-dtor -o %t && %run %t >%t.out 2>&1
1111
// RUN: FileCheck %s --check-prefix=CHECK-NO-FLAG < %t.out
1212

13-
// RUN: %clangxx_msan -fsanitize=memory -fsanitize-memory-use-after-dtor %s -o %t && MSAN_OPTIONS=poison_in_dtor=0 %run %t >%t.out 2>&1
13+
// RUN: %clangxx_msan -fsanitize=memory -fsanitize-memory-use-after-dtor %s -o %t && env MSAN_OPTIONS=poison_in_dtor=0 %run %t >%t.out 2>&1
1414
// RUN: FileCheck %s --check-prefix=CHECK-NO-FLAG < %t.out
1515

1616
#include <sanitizer/msan_interface.h>

compiler-rt/test/msan/fork.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// and verify that origin reads do not deadlock in the child process.
44

55
// RUN: %clangxx_msan -std=c++11 -fsanitize-memory-track-origins=2 -g -O3 %s -o %t
6-
// RUN: MSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t 2>&1 | FileCheck %s
6+
// RUN: env MSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t 2>&1 | FileCheck %s
77

88
// Fun fact: if test output is redirected to a file (as opposed to
99
// being piped directly to FileCheck), we may lose some "done"s due to

compiler-rt/test/msan/interception_sigaction_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx_msan -O0 -g %s -o %t
2-
// RUN: MSAN_OPTIONS=handle_segv=2 %t 2>&1 | FileCheck %s
2+
// RUN: env MSAN_OPTIONS=handle_segv=2 %t 2>&1 | FileCheck %s
33
#include <stdlib.h>
44
#include <stdio.h>
55
#include <unistd.h>

compiler-rt/test/msan/memcmp_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clangxx_msan -O0 -g %s -o %t
22
// RUN: not %run %t 2>&1 | FileCheck %s
3-
// RUN: MSAN_OPTIONS=intercept_memcmp=0 %run %t
3+
// RUN: env MSAN_OPTIONS=intercept_memcmp=0 %run %t
44

55
#include <string.h>
66
#include <stdio.h>

compiler-rt/test/msan/msan_check_mem_is_initialized.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clangxx_msan -O0 -g -DPOSITIVE %s -o %t
22
// RUN: not %run %t 2>&1 | FileCheck %s
3-
// RUN: MSAN_OPTIONS=verbosity=1 not %run %t 2>&1 | \
3+
// RUN: env MSAN_OPTIONS=verbosity=1 not %run %t 2>&1 | \
44
// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-VERBOSE
55

66
// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t

compiler-rt/test/msan/poison_in_free.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
22
// FileCheck %s <%t.out
3-
// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=poison_in_free=0 %run %t >%t.out 2>&1
3+
// RUN: %clangxx_msan -O0 %s -o %t && env MSAN_OPTIONS=poison_in_free=0 %run %t >%t.out 2>&1
44

55
#include <stdio.h>
66
#include <stdlib.h>

compiler-rt/test/msan/print_stats.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g %s -o %t
1+
// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g %s -o %t
22
// RUN: %run %t 2>&1 | \
33
// RUN: FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s
4-
// RUN: MSAN_OPTIONS=print_stats=1 %run %t 2>&1 | \
4+
// RUN: env MSAN_OPTIONS=print_stats=1 %run %t 2>&1 | \
55
// RUN: FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s
6-
// RUN: MSAN_OPTIONS=print_stats=1,atexit=1 %run %t 2>&1 | \
6+
// RUN: env MSAN_OPTIONS=print_stats=1,atexit=1 %run %t 2>&1 | \
77
// RUN: FileCheck --check-prefixes=CHECK,CHECK-STATS %s
88

9-
// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 %s -o %t
9+
// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 %s -o %t
1010
// RUN: not %run %t 2>&1 | \
1111
// RUN: FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s
12-
// RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
12+
// RUN: env MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
1313
// RUN: FileCheck --check-prefixes=CHECK,CHECK-STATS %s
1414

1515
// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -fsanitize-recover=memory -g -DPOSITIVE=1 %s -o %t
1616
// RUN: not %run %t 2>&1 | \
1717
// RUN: FileCheck --check-prefixes=CHECK,CHECK-NOSTATS,CHECK-RECOVER %s
18-
// RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
18+
// RUN: env MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
1919
// RUN: FileCheck --check-prefixes=CHECK,CHECK-STATS,CHECK-RECOVER %s
2020

2121
#include <stdio.h>

compiler-rt/test/msan/recover-dso.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
22
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
3-
// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
3+
// RUN: %clangxx_msan -O0 %s -o %t && env MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
44
// FileCheck %s <%t.out
5-
// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
5+
// RUN: %clangxx_msan -O0 %s -o %t && env MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
66
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
77

88
// Test how -fsanitize-recover=memory and MSAN_OPTIONS=keep_going affect reports
@@ -12,9 +12,9 @@
1212

1313
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && not %run %t >%t.out 2>&1
1414
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
15-
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
15+
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && env MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
1616
// FileCheck %s <%t.out
17-
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
17+
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && env MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
1818
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
1919

2020
// Test how legacy -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going affect

compiler-rt/test/msan/recover.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
22
// FileCheck %s <%t.out
3-
// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
3+
// RUN: %clangxx_msan -O0 %s -o %t && env MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
44
// FileCheck %s <%t.out
5-
// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
5+
// RUN: %clangxx_msan -O0 %s -o %t && env MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
66
// FileCheck %s <%t.out
77

88
// Test behavior of -fsanitize-recover=memory and MSAN_OPTIONS=keep_going.
@@ -11,20 +11,20 @@
1111

1212
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && not %run %t >%t.out 2>&1
1313
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
14-
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
14+
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && env MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
1515
// FileCheck %s <%t.out
16-
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
16+
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && env MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
1717
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
18-
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=1 not %run %t >%t.out 2>&1
18+
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && env MSAN_OPTIONS=halt_on_error=1 not %run %t >%t.out 2>&1
1919
// FileCheck %s <%t.out
20-
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=0 not %run %t >%t.out 2>&1
20+
// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && env MSAN_OPTIONS=halt_on_error=0 not %run %t >%t.out 2>&1
2121
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
2222

2323
// Basic test of legacy -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going.
2424

2525
// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
2626
// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
27-
// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
27+
// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && env MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
2828
// FileCheck %s <%t.out
2929

3030
#include <stdio.h>

compiler-rt/test/msan/release_origin.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_msan -fsanitize-memory-track-origins=0 -O0 %s -o %t && MSAN_OPTIONS=soft_rss_limit_mb=18:verbosity=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -implicit-check-not="soft rss limit" -check-prefixes=CHECK,NOORIG
2-
// RUN: %clang_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && MSAN_OPTIONS=soft_rss_limit_mb=36:verbosity=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -implicit-check-not="soft rss limit" -check-prefixes=CHECK,ORIGIN
1+
// RUN: %clang_msan -fsanitize-memory-track-origins=0 -O0 %s -o %t && env MSAN_OPTIONS=soft_rss_limit_mb=18:verbosity=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -implicit-check-not="soft rss limit" -check-prefixes=CHECK,NOORIG
2+
// RUN: %clang_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && env MSAN_OPTIONS=soft_rss_limit_mb=36:verbosity=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -implicit-check-not="soft rss limit" -check-prefixes=CHECK,ORIGIN
33

44
#include <assert.h>
55
#include <sanitizer/allocator_interface.h>
@@ -39,4 +39,4 @@ int main(int argc, char **argv) {
3939
// CHECK-LABEL: free
4040

4141
// Now non-origin release all everything.
42-
// NOORIG: soft rss limit unexhausted
42+
// NOORIG: soft rss limit unexhausted

compiler-rt/test/msan/strcmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_msan %s -o %t
2-
// RUN: MSAN_OPTIONS=intercept_strcmp=false %run %t 2>&1
3-
// RUN: MSAN_OPTIONS=intercept_strcmp=true not %run %t 2>&1 | FileCheck %s
2+
// RUN: env MSAN_OPTIONS=intercept_strcmp=false %run %t 2>&1
3+
// RUN: env MSAN_OPTIONS=intercept_strcmp=true not %run %t 2>&1 | FileCheck %s
44
// RUN: not %run %t 2>&1 | FileCheck %s
55

66
#include <assert.h>

compiler-rt/test/msan/strndup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx_msan %s -o %t && not %run %t 2>&1 | FileCheck --check-prefix=ON %s
2-
// RUN: %clangxx_msan %s -o %t && MSAN_OPTIONS=intercept_strndup=0 %run %t 2>&1 | FileCheck --check-prefix=OFF --allow-empty %s
2+
// RUN: %clangxx_msan %s -o %t && env MSAN_OPTIONS=intercept_strndup=0 %run %t 2>&1 | FileCheck --check-prefix=OFF --allow-empty %s
33

44
// When built as C on Linux, strndup is transformed to __strndup.
55
// RUN: %clangxx_msan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck --check-prefix=ON %s

0 commit comments

Comments
 (0)