[llvm-branch-commits] [ASan] Make most tests run under internal shell on Darwin (PR #168545)

2025-11-19 Thread Dan Blackwell via llvm-branch-commits


@@ -5,7 +5,7 @@
 // - By default the lit config sets this but we don't want this
 //   test to implicitly depend on this.
 // - It avoids requiring `--crash` to be passed to `not`.
-// RUN: APPLE_ASAN_INIT_FOR_DLOPEN=0 %env_asan_opts=abort_on_error=0 not \
+// RUN: env APPLE_ASAN_INIT_FOR_DLOPEN=0 %env_asan_opts=abort_on_error=0 not \

DanBlackwell wrote:

```suggestion
// RUN: %env_asan_opts=abort_on_error=0 APPLE_ASAN_INIT_FOR_DLOPEN=0 not \
```
`%env_asan_opts` expands to `env ASAN_OPTIONS=`

https://github.com/llvm/llvm-project/pull/168545
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [ASan] Make most tests run under internal shell on Darwin (PR #168545)

2025-11-19 Thread Dan Blackwell via llvm-branch-commits


@@ -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
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [ASan] Make most tests run under internal shell on Darwin (PR #168545)

2025-11-19 Thread Dan Blackwell via llvm-branch-commits

https://github.com/DanBlackwell requested changes to this pull request.


https://github.com/llvm/llvm-project/pull/168545
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [ASan] Make most tests run under internal shell on Darwin (PR #168545)

2025-11-19 Thread Dan Blackwell via llvm-branch-commits


@@ -24,7 +24,8 @@
 // RUN: diff %t.imports-sorted %t.exports-sorted
 
 // Ensure that there is no dynamic dylib linked.
-// RUN: otool -L %t | (! grep -q "dynamic.dylib")
+// RUN: otool -L %t > %t.libs 
+// not grep -q "dynamic.dylib" < %t.libs

DanBlackwell wrote:

```suggestion
// RUN: not grep -q "dynamic.dylib" < %t.libs
```

https://github.com/llvm/llvm-project/pull/168545
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits