Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compiler-rt][test] Add env command to fix command not found errors in compiler-rt with lit internal shell #105917

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

Harini0924
Copy link
Contributor

@Harini0924 Harini0924 commented Aug 24, 2024

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: #106598
This change is relevant [RFC] Enabling the lit internal shell by Default

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.
@llvmbot
Copy link
Member

llvmbot commented Aug 24, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (Harini0924)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/105917.diff

5 Files Affected:

  • (modified) compiler-rt/test/nsan/Posix/tls_reuse.c (+1-1)
  • (modified) compiler-rt/test/nsan/nan.cpp (+3-3)
  • (modified) compiler-rt/test/nsan/softmax.cpp (+5-5)
  • (modified) compiler-rt/test/nsan/sum.cpp (+4-4)
  • (modified) compiler-rt/test/nsan/vec_sqrt_ext.cpp (+3-3)
diff --git a/compiler-rt/test/nsan/Posix/tls_reuse.c b/compiler-rt/test/nsan/Posix/tls_reuse.c
index e323260d15e385..6afa14b021bafd 100644
--- a/compiler-rt/test/nsan/Posix/tls_reuse.c
+++ b/compiler-rt/test/nsan/Posix/tls_reuse.c
@@ -1,6 +1,6 @@
 /// The static TLS block is reused among by threads. The shadow is cleared.
 // RUN: %clang_nsan %s -o %t
-// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
+// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/compiler-rt/test/nsan/nan.cpp b/compiler-rt/test/nsan/nan.cpp
index 59fc391a3e0a6b..c96ac261a233d4 100644
--- a/compiler-rt/test/nsan/nan.cpp
+++ b/compiler-rt/test/nsan/nan.cpp
@@ -1,11 +1,11 @@
 // RUN: %clangxx_nsan -O0 -g %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
 
 // RUN: %clangxx_nsan -O3 -g %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
 
 // RUN: %clangxx_nsan -O0 -g %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=1 not %run %t
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=1 not %run %t
 
 #include <cmath>
 #include <cstdio>
diff --git a/compiler-rt/test/nsan/softmax.cpp b/compiler-rt/test/nsan/softmax.cpp
index 29eaa2f9607a20..ebe43dd087f799 100644
--- a/compiler-rt/test/nsan/softmax.cpp
+++ b/compiler-rt/test/nsan/softmax.cpp
@@ -1,14 +1,14 @@
 // RUN: %clangxx_nsan -O0 -g -DSOFTMAX=softmax %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
 
 // RUN: %clangxx_nsan -O3 -g -DSOFTMAX=softmax %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
 
 // RUN: %clangxx_nsan -O0 -g -DSOFTMAX=stable_softmax %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t 
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t 
 
 // RUN: %clangxx_nsan -O3 -g -DSOFTMAX=stable_softmax %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=1,log2_max_relative_error=19 %run %t
 
 #include<iostream>
 #include<vector>
@@ -51,4 +51,4 @@ int main() {
     // CHECK: WARNING: NumericalStabilitySanitizer: NaN detected
   }
   return 0;
-}
\ No newline at end of file
+}
diff --git a/compiler-rt/test/nsan/sum.cpp b/compiler-rt/test/nsan/sum.cpp
index 31bd62e73966bb..cd161c59bd60c3 100644
--- a/compiler-rt/test/nsan/sum.cpp
+++ b/compiler-rt/test/nsan/sum.cpp
@@ -1,14 +1,14 @@
 // RUN: %clangxx_nsan -O0 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=NaiveSum -DFLT=float %s -o %t
-// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
 
 // RUN: %clangxx_nsan -O3 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=NaiveSum -DFLT=float %s -o %t
-// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 not %run %t 2>&1 | FileCheck %s
 
 // RUN: %clangxx_nsan -O0 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=KahanSum -DFLT=float %s -o %t
-// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
+// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
 
 // RUN: %clangxx_nsan -O3 -mllvm -nsan-shadow-type-mapping=dqq -g -DSUM=KahanSum -DFLT=float %s -o %t
-// RUN: NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
+// RUN: env NSAN_OPTIONS=halt_on_error=1,log2_max_relative_error=19 %run %t
 
 #include <chrono>
 #include <iostream>
diff --git a/compiler-rt/test/nsan/vec_sqrt_ext.cpp b/compiler-rt/test/nsan/vec_sqrt_ext.cpp
index b39ce4b99bcab6..683cb458e54ae8 100644
--- a/compiler-rt/test/nsan/vec_sqrt_ext.cpp
+++ b/compiler-rt/test/nsan/vec_sqrt_ext.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_nsan -O0 -g -mavx %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_nsan -O3 -g -mavx %s -o %t
-// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
+// RUN: env NSAN_OPTIONS=check_nan=true,halt_on_error=0 %run %t 2>&1 | FileCheck %s
 #include <iostream>
 #include <cmath>
 
@@ -22,4 +22,4 @@ int main() {
     // CHECK: WARNING: NumericalStabilitySanitizer: NaN detected
   }
   return 0;
-}
\ No newline at end of file
+}

@Harini0924 Harini0924 changed the title [compiler-rt][test] Fixing Command not found errors in compiler-rt with lit internal shell [compiler-rt][test] Add env command to fix command not found errors in compiler-rt with lit internal shell Aug 25, 2024
@vitalybuka vitalybuka merged commit 52ae891 into llvm:main Aug 26, 2024
8 checks passed
dmpolukhin pushed a commit to dmpolukhin/llvm-project that referenced this pull request Sep 2, 2024
… in compiler-rt with lit internal shell (llvm#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: llvm#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[llvm-lit] Environment variable not found in compiler-rt subproject with lit internal shell
3 participants