[compiler-rt] [compiler-rt][test] Added `env` command to fix NSAN_OPTIONS command not found error (PR #106676)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 23:59:24 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: None (Harini0924)

<details>
<summary>Changes</summary>

Resolved the issue where `'NSAN_OPTIONS=check_nan=true,halt_on_error=0'` was not recognized as a command. Changed the test command to set the environment variable correctly using `env`. 
fixes: #<!-- -->106598

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


1 Files Affected:

- (modified) compiler-rt/test/nsan/vec_sqrt.cpp (+3-3) 


``````````diff
diff --git a/compiler-rt/test/nsan/vec_sqrt.cpp b/compiler-rt/test/nsan/vec_sqrt.cpp
index d1ef0487858506..64a7130322873c 100644
--- a/compiler-rt/test/nsan/vec_sqrt.cpp
+++ b/compiler-rt/test/nsan/vec_sqrt.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 <cmath>
 #include <immintrin.h>
@@ -31,4 +31,4 @@ int main() {
     // CHECK: WARNING: NumericalStabilitySanitizer: NaN detected
   }
   return 0;
-}
\ No newline at end of file
+}

``````````

</details>


https://github.com/llvm/llvm-project/pull/106676


More information about the llvm-commits mailing list