Skip to content

Conversation

cmtice
Copy link
Contributor

@cmtice cmtice commented Sep 10, 2025

The lit internal shell needs environment variable definitions to be preceded by the 'env' keyword. This PR add that to tests that were missing it.

The lit internal shell needs environment variable definitions to be
preceded by the 'env' keyword. This PR add that to tests that were
missing it.
@llvmbot
Copy link
Member

llvmbot commented Sep 10, 2025

@llvm/pr-subscribers-xray

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

Author: None (cmtice)

Changes

The lit internal shell needs environment variable definitions to be preceded by the 'env' keyword. This PR add that to tests that were missing it.


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

6 Files Affected:

  • (modified) compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp (+1-1)
  • (modified) compiler-rt/test/rtsan/unrecognized_flags.cpp (+1-1)
  • (modified) compiler-rt/test/xray/TestCases/Posix/dlopen.cpp (+1-1)
  • (modified) compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp (+1-1)
  • (modified) compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp (+1-1)
  • (modified) compiler-rt/test/xray/TestCases/Posix/patching-unpatching-dso.cpp (+1-1)
diff --git a/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp b/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
index 91acd28a1a5ff..b045ec704cec2 100644
--- a/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
+++ b/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
@@ -4,7 +4,7 @@
 // Android HWAsan does not support LSan.
 // UNSUPPORTED: android
 
-// RUN: %clangxx_hwasan -O0 %s -o %t && HWASAN_OPTIONS=detect_leaks=1 %run %t
+// RUN: %clangxx_hwasan -O0 %s -o %t && env HWASAN_OPTIONS=detect_leaks=1 %run %t
 
 #include <assert.h>
 #include <dlfcn.h>
diff --git a/compiler-rt/test/rtsan/unrecognized_flags.cpp b/compiler-rt/test/rtsan/unrecognized_flags.cpp
index 9e44e9f429936..d6649db6b0fba 100644
--- a/compiler-rt/test/rtsan/unrecognized_flags.cpp
+++ b/compiler-rt/test/rtsan/unrecognized_flags.cpp
@@ -1,5 +1,5 @@
 // RUN: %clangxx -fsanitize=realtime %s -o %t
-// RUN: RTSAN_OPTIONS="verbosity=1,asdf=1" %run %t 2>&1 | FileCheck %s
+// RUN: env RTSAN_OPTIONS="verbosity=1,asdf=1" %run %t 2>&1 | FileCheck %s
 // UNSUPPORTED: ios
 
 // Intent: Make sure we are respecting some basic common flags
diff --git a/compiler-rt/test/xray/TestCases/Posix/dlopen.cpp b/compiler-rt/test/xray/TestCases/Posix/dlopen.cpp
index 9567269e8ff1b..5326d83dfdd79 100644
--- a/compiler-rt/test/xray/TestCases/Posix/dlopen.cpp
+++ b/compiler-rt/test/xray/TestCases/Posix/dlopen.cpp
@@ -5,7 +5,7 @@
 // RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -shared -std=c++11 %t/testlib.cpp -o %t/testlib.so
 // RUN: %clangxx_xray -g -fPIC -rdynamic -fxray-instrument -fxray-shared -std=c++11 %t/main.cpp -o %t/main.o
 //
-// RUN: XRAY_OPTIONS="patch_premain=true" %run %t/main.o %t/testlib.so 2>&1 | FileCheck %s
+// RUN: env XRAY_OPTIONS="patch_premain=true" %run %t/main.o %t/testlib.so 2>&1 | FileCheck %s
 
 // REQUIRES: target={{(aarch64|x86_64)-.*}}
 
diff --git a/compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp b/compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp
index 82cc127b521a6..3b4564306abd6 100644
--- a/compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp
+++ b/compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp
@@ -15,7 +15,7 @@
 // Executable links with a and b explicitly and loads d and e at runtime.
 // RUN: %clangxx_xray -g -fPIC -rdynamic -fxray-instrument -fxray-shared -std=c++11 %t/main.cpp %t/testliba.so %t/testlibb.so -o %t/main.o
 //
-// RUN:  XRAY_OPTIONS="patch_premain=true" %run %t/main.o %t/testlibd.so %t/testlibe.so 2>&1 | FileCheck %s
+// RUN:  env XRAY_OPTIONS="patch_premain=true" %run %t/main.o %t/testlibd.so %t/testlibe.so 2>&1 | FileCheck %s
 
 // REQUIRES: target={{(aarch64|x86_64)-.*}}
 
diff --git a/compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp b/compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp
index 7bce653fe7233..5014fce61d5b7 100644
--- a/compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp
+++ b/compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp
@@ -4,7 +4,7 @@
 // RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -shared -std=c++11 %t/testlib.cpp -o %t/testlib.so
 // RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -std=c++11 %t/main.cpp %t/testlib.so -Wl,-rpath,%t -o %t/main.o
 
-// RUN: XRAY_OPTIONS="patch_premain=true,verbosity=1" %run %t/main.o 2>&1 | FileCheck %s
+// RUN: env XRAY_OPTIONS="patch_premain=true,verbosity=1" %run %t/main.o 2>&1 | FileCheck %s
 
 // REQUIRES: target={{(aarch64|x86_64)-.*}}
 
diff --git a/compiler-rt/test/xray/TestCases/Posix/patching-unpatching-dso.cpp b/compiler-rt/test/xray/TestCases/Posix/patching-unpatching-dso.cpp
index 640cf9bcc1a34..9b3f63b5368a9 100644
--- a/compiler-rt/test/xray/TestCases/Posix/patching-unpatching-dso.cpp
+++ b/compiler-rt/test/xray/TestCases/Posix/patching-unpatching-dso.cpp
@@ -6,7 +6,7 @@
 // RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -shared -std=c++11 %t/testlib.cpp -o %t/testlib.so
 // RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -std=c++11 %t/main.cpp %t/testlib.so -Wl,-rpath,%t -o %t/main.o
 
-// RUN: XRAY_OPTIONS="patch_premain=false" %run %t/main.o 2>&1 | FileCheck %s
+// RUN: env XRAY_OPTIONS="patch_premain=false" %run %t/main.o 2>&1 | FileCheck %s
 
 // REQUIRES: target={{(aarch64|x86_64)-.*}}
 

Copy link
Contributor

@fmayer fmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@cmtice cmtice merged commit 5ceb450 into llvm:main Sep 10, 2025
14 checks passed
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.

4 participants