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
5 changes: 4 additions & 1 deletion compiler-rt/test/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_so" + postfix,
"-install_name @rpath/`basename %dynamiclib{}`".format(postfix),
"-install_name @rpath/%base_dynamiclib{}".format(postfix),
)
)
elif config.target_os in ("FreeBSD", "NetBSD", "OpenBSD"):
Expand Down Expand Up @@ -908,6 +908,9 @@ def is_windows_lto_supported():
config.substitutions.append(
("%dynamiclib" + postfix, "%t.dir/%xdynamiclib_filename" + postfix)
)
config.substitutions.append(
("%base_dynamiclib" + postfix, "%xdynamiclib_filename" + postfix)
)
config.substitutions.append(
(
"%xdynamiclib_filename" + postfix,
Expand Down
7 changes: 4 additions & 3 deletions compiler-rt/test/tsan/Darwin/dlopen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
// RUN: %clangxx_tsan %s -o %t.so -shared -DSHARED_LIB
// RUN: %clangxx_tsan -fno-sanitize=thread %s -o %t

// RUN: TSAN_DYLIB_PATH=`%clangxx_tsan %s -### 2>&1 \
// RUN: %clangxx_tsan %s -### 2>&1 \
// RUN: | grep "libclang_rt.tsan_osx_dynamic.dylib" \
// RUN: | sed -e 's/.*"\(.*libclang_rt.tsan_osx_dynamic.dylib\)".*/\1/'`
// RUN: | sed -e 's/.*"\(.*libclang_rt.tsan_osx_dynamic.dylib\)".*/\1/' \
// RUN: | tr -d '\n' > %t.tsan_dylib_path

// Launching a non-instrumented binary that dlopen's an instrumented library should fail.
// RUN: not %run %t %t.so 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL
// Launching a non-instrumented binary with an explicit DYLD_INSERT_LIBRARIES should work.
// RUN: DYLD_INSERT_LIBRARIES=$TSAN_DYLIB_PATH %run %t %t.so 2>&1 | FileCheck %s
// RUN: env DYLD_INSERT_LIBRARIES="%{readfile:%t.tsan_dylib_path}" %run %t %t.so 2>&1 | FileCheck %s

#include <dlfcn.h>
#include <pthread.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// RUN: basename %t-lib.dylib | tr -d '\n' > %t.basename
// RUN: %clangxx_tsan -shared %p/external-lib.cpp -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
// RUN: -o %t-lib.dylib -install_name @rpath/`basename %t-lib.dylib`
// RUN: -o %t-lib.dylib -install_name @rpath/%{readfile:%t.basename}

// RUN: basename %t-module.dylib | tr -d '\n' > %t.basename
// RUN: %clangxx_tsan -shared %p/external-noninstrumented-module.cpp %t-lib.dylib -fno-sanitize=thread \
// RUN: -o %t-module.dylib -install_name @rpath/`basename %t-module.dylib`
// RUN: -o %t-module.dylib -install_name @rpath/%{readfile:%t.basename}

// RUN: %clangxx_tsan %s %t-module.dylib -o %t
// RUN: %run %t 2>&1 | FileCheck %s
Expand Down
9 changes: 6 additions & 3 deletions compiler-rt/test/tsan/Darwin/external.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// RUN: basename %t-lib-instrumented.dylib | tr -d '\n' > %t.basename
// RUN: %clangxx_tsan %p/external-lib.cpp -shared \
// RUN: -o %t-lib-instrumented.dylib \
// RUN: -install_name @rpath/`basename %t-lib-instrumented.dylib`
// RUN: -install_name @rpath/%{readfile:%t.basename}

// RUN: basename %t-lib-noninstrumented.dylib | tr -d '\n' > %t.basename
// RUN: %clangxx_tsan %p/external-lib.cpp -shared -fno-sanitize=thread \
// RUN: -o %t-lib-noninstrumented.dylib \
// RUN: -install_name @rpath/`basename %t-lib-noninstrumented.dylib`
// RUN: -install_name @rpath/%{readfile:%t.basename}

// RUN: basename %t-lib-noninstrumented-callbacks.dylib | tr -d '\n' > %t.basename
// RUN: %clangxx_tsan %p/external-lib.cpp -shared -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
// RUN: -o %t-lib-noninstrumented-callbacks.dylib \
// RUN: -install_name @rpath/`basename %t-lib-noninstrumented-callbacks.dylib`
// RUN: -install_name @rpath/%{readfile:%t.basename}

// RUN: %clangxx_tsan %s %t-lib-instrumented.dylib -o %t-lib-instrumented
// RUN: %clangxx_tsan %s %t-lib-noninstrumented.dylib -o %t-lib-noninstrumented
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/tsan/Darwin/malloc-stack-logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// use syscalls directly) to make sure other interceptors aren't called.

// RUN: %clangxx_tsan -O1 %s -o %t
// RUN: MallocStackLogging=1 %run %t 2>&1 | FileCheck %s
// RUN: env MallocStackLogging=1 %run %t 2>&1 | FileCheck %s
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Loading