[compiler-rt] [ASan] Make most tests run under internal shell on Darwin (PR #168545)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 18 07:44:37 PST 2025
================
@@ -5,29 +5,34 @@
// UNSUPPORTED: ios
// RUN: rm -rf %t && mkdir -p %t
-// RUN: cp `%clang_asan -print-file-name=lib`/darwin/libclang_rt.asan_osx_dynamic.dylib \
+// RUN: %clang_asan -print-file-name=lib | tr -d '\n' > %t.lib_name
+// RUN: cp %{readfile:%t.lib_name}/darwin/libclang_rt.asan_osx_dynamic.dylib \
// RUN: %t/libclang_rt.asan_osx_dynamic.dylib
// RUN: %clangxx_asan %s -o %t/a.out
// RUN: %clangxx -DSHARED_LIB %s \
// RUN: -dynamiclib -o %t/dummy-so.dylib
-// RUN: ( cd %t && \
-// RUN: DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
-// RUN: %run ./a.out 2>&1 ) | FileCheck %s || exit 1
-
-// RUN: ( cd %t && \
-// RUN: DYLD_INSERT_LIBRARIES=libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
-// RUN: %run ./a.out 2>&1 ) | FileCheck %s || exit 1
-
-// RUN: ( cd %t && \
-// RUN: %env_asan_opts=strip_env=0 \
-// RUN: DYLD_INSERT_LIBRARIES=libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
-// RUN: %run ./a.out 2>&1 ) | FileCheck %s --check-prefix=CHECK-KEEP || exit 1
-
-// RUN: ( cd %t && \
-// RUN: DYLD_INSERT_LIBRARIES=%t/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
-// RUN: %run ./a.out 2>&1 ) | FileCheck %s || exit 1
+// RUN: pushd %t
+// RUN: env DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
+// RUN: %run ./a.out 2>&1 | FileCheck %s
+// RUN: popd
----------------
boomanaiden154 wrote:
Fixed. Not entirely sure either. I normally try and preserve the exact semantics of the test just in case there is some test fidelity issue, but all of the directory changing in subshells does seem completely redundant.
https://github.com/llvm/llvm-project/pull/168545
More information about the llvm-commits
mailing list