Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Check that when having a DYLD_ROOT_PATH set, the symbolizer still works.
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: %env_asan_opts=verbosity=2 DYLD_ROOT_PATH="/" ASAN_SYMBOLIZER_PATH=$(which atos) \
// RUN: which atos | tr -d '\n' > %t.symbolizer_path
// RUN: %env_asan_opts=verbosity=2 DYLD_ROOT_PATH="/" ASAN_SYMBOLIZER_PATH=%{readfile:%t.symbolizer_path} \
// RUN: not %run %t 2>&1 | FileCheck %s
//
// Due to a bug in atos, this only works on x86_64.
Expand Down
3 changes: 2 additions & 1 deletion compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Check that the `atos` symbolizer works.

// RUN: %clangxx_asan -O0 %s -o %t
// RUN: %env_asan_opts=verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s
// RUN: which atos | tr -d '\n' > %t.symbolizer_path
// RUN: %env_asan_opts=verbosity=2 ASAN_SYMBOLIZER_PATH=%{readfile:%t.symbolizer_path} not %run %t 2>&1 | FileCheck %s

// Path returned by `which atos` is invalid on iOS.
// UNSUPPORTED: ios, i386-darwin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
// 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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,27 @@
// 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: env DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
// RUN: %run ./a.out 2>&1 | FileCheck %s

// 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: env DYLD_INSERT_LIBRARIES=libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
// RUN: %run ./a.out 2>&1 | FileCheck %s

// 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: %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

// 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: env DYLD_INSERT_LIBRARIES=%t/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \
// RUN: %run ./a.out 2>&1 | FileCheck %s

#if !defined(SHARED_LIB)
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/TestCases/Darwin/init_for_dlopen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_asan_opts=abort_on_error=0 APPLE_ASAN_INIT_FOR_DLOPEN=0 not \
// RUN: %run %t %shared_libasan 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-DL-OPEN-FAIL %s
// RUN: env -u APPLE_ASAN_INIT_FOR_DLOPEN %env_asan_opts=abort_on_error=0 not \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#include <stdio.h>

// RUN: %clangxx_asan %s -o %t
// RUN: ASAN_OPTIONS="abort_on_error=1" not --crash %run %t 2>&1 | FileCheck %s

// RUN: env ASAN_OPTIONS="abort_on_error=1" not --crash %run %t 2>&1 | FileCheck %s

void *pwn(malloc_zone_t *unused_zone, size_t unused_size) {
printf("PWNED\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
// RUN: not grep -q "dynamic.dylib" < %t.libs

// UNSUPPORTED: ios

Expand Down
Loading