[TSan] Allow test contents to be copied before execution
authorJulian Lettner <julian.lettner@apple.com>
Sat, 10 Apr 2021 01:02:39 +0000 (18:02 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Mon, 12 Apr 2021 20:30:06 +0000 (13:30 -0700)
Allow test contents to be copied before execution by using
`%ld_flags_rpath_so`, `%ld_flags_rpath_exe`, and `%dynamiclib`
substitutions.

rdar://76302416

Differential Revision: https://reviews.llvm.org/D100240

compiler-rt/test/tsan/on_initialize_finalize_hooks.cpp

index 0b82ec1..3f7b56b 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clang_tsan -O1 %s -o %t.lib -fno-sanitize=thread -shared -fPIC -DBUILD_LIB=1
-// RUN: %clang_tsan -O1 %s %t.lib -o %t
+// RUN: %clang_tsan -O1 %s -DBUILD_LIB=1 -fno-sanitize=thread -shared -fPIC -o %dynamiclib %ld_flags_rpath_so
+// RUN: %clang_tsan -O1 %s -o %t %ld_flags_rpath_exe
 // RUN: %run %t | FileCheck %s
 
 // Test that initialization/finalization hooks are called, even when they are