Skip to content

Commit 52ae891

Browse files
authored
[compiler-rt][test] Add env command to fix command not found errors in compiler-rt with lit internal shell (#105917)
There are several files in the compiler-rt subproject that have command not found errors. This patch uses the `env` command to properly set the environment variables correctly when using the lit internal shell. fixes: #102395 [This change is relevant [RFC] Enabling the lit internal shell by Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179)
1 parent 2579b41 commit 52ae891

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

compiler-rt/test/nsan/Posix/tls_reuse.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// The static TLS block is reused among by threads. The shadow is cleared.
22
// RUN: %clang_nsan %s -o %t
3-
// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
3+
// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
44

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

compiler-rt/test/nsan/nan.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %clangxx_nsan -O0 -g %s -o %t
2-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
2+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
33

44
// RUN: %clangxx_nsan -O3 -g %s -o %t
5-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
5+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
66

77
// RUN: %clangxx_nsan -O0 -g %s -o %t
8-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=1 not %run %t
8+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=1 not %run %t
99

1010
#include <cmath>
1111
#include <cstdio>

compiler-rt/test/nsan/softmax.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// RUN: %clangxx_nsan -O0 -g -DSOFTMAX=softmax %s -o %t
2-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
2+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
33

44
// RUN: %clangxx_nsan -O3 -g -DSOFTMAX=softmax %s -o %t
5-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
5+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
66

77
// RUN: %clangxx_nsan -O0 -g -DSOFTMAX=stable_softmax %s -o %t
8-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t
8+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t
99

1010
// RUN: %clangxx_nsan -O3 -g -DSOFTMAX=stable_softmax %s -o %t
11-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t
11+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t
1212

1313
#include<iostream>
1414
#include<vector>
@@ -51,4 +51,4 @@ int main() {
5151
// CHECK: WARNING: NumericalStabilitySanitizer: NaN detected
5252
}
5353
return 0;
54-
}
54+
}

compiler-rt/test/nsan/sum.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// RUN: %clangxx_nsan -O0 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=NaiveSum -DFLT=float %s -o %t
2-
// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
2+
// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
33

44
// RUN: %clangxx_nsan -O3 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=NaiveSum -DFLT=float %s -o %t
5-
// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
5+
// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
66

77
// RUN: %clangxx_nsan -O0 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=KahanSum -DFLT=float %s -o %t
8-
// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
8+
// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
99

1010
// RUN: %clangxx_nsan -O3 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=KahanSum -DFLT=float %s -o %t
11-
// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
11+
// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
1212

1313
#include <chrono>
1414
#include <iostream>

compiler-rt/test/nsan/vec_sqrt_ext.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clangxx_nsan -O0 -g -mavx %s -o %t
2-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
2+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
33
// RUN: %clangxx_nsan -O3 -g -mavx %s -o %t
4-
// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
4+
// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
55
#include <iostream>
66
#include <cmath>
77

@@ -22,4 +22,4 @@ int main() {
2222
// CHECK: WARNING: NumericalStabilitySanitizer: NaN detected
2323
}
2424
return 0;
25-
}
25+
}

0 commit comments

Comments
 (0)