From 93b5c2a5efaa6bf07caf34f5af825056bdf5a950 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Wed, 10 Sep 2025 08:47:08 -0700 Subject: [PATCH] [compiler-rt] Update some tests to pass with lit internal shell. 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. --- compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp | 2 +- compiler-rt/test/rtsan/unrecognized_flags.cpp | 2 +- compiler-rt/test/xray/TestCases/Posix/dlopen.cpp | 2 +- compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp | 2 +- compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp | 2 +- .../test/xray/TestCases/Posix/patching-unpatching-dso.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) 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 #include 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)-.*}}