[llvm-branch-commits] [ASan] Make most tests run under internal shell on Darwin (PR #168545)
Dan Blackwell via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Nov 18 06:55:01 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
----------------
DanBlackwell wrote:
NIT: I'm missing context as to why this was done the way it was in the original code, but it seems the popd-pushd here are redundant.
https://github.com/llvm/llvm-project/pull/168545
More information about the llvm-branch-commits
mailing list