[tsan][test] Remaining tests requiring weak symbols for dyld64

Differential Revision: https://reviews.llvm.org/D130917
This commit is contained in:
Roy Sundahl 2022-08-01 10:43:52 -07:00
parent 3b9bee1651
commit 3879d3edef
4 changed files with 24 additions and 4 deletions

View File

@ -42,7 +42,12 @@ int main() {
return 0;
}
__attribute__((disable_sanitizer_instrumentation)) void
// Required for dyld macOS 12.0+
#if (__APPLE__)
__attribute__((weak))
#endif
__attribute__((disable_sanitizer_instrumentation))
extern "C" void
__tsan_on_report(void *report) {
const char *type;
void *addr;

View File

@ -13,8 +13,13 @@ int __tsan_get_report_thread(void *report, unsigned long idx, int *tid,
unsigned long trace_size);
}
// Required for dyld macOS 12.0+
#if (__APPLE__)
__attribute__((weak))
#endif
__attribute__((disable_sanitizer_instrumentation))
void __tsan_on_report(void *report) {
extern "C" void
__tsan_on_report(void *report) {
fprintf(stderr, "__tsan_on_report(%p)\n", report);
int tid;

View File

@ -46,7 +46,12 @@ int main() {
fprintf(stderr, "Done.\n");
}
__attribute__((disable_sanitizer_instrumentation)) void
// Required for dyld macOS 12.0+
#if (__APPLE__)
__attribute__((weak))
#endif
__attribute__((disable_sanitizer_instrumentation))
extern "C" void
__tsan_on_report(void *report) {
fprintf(stderr, "__tsan_on_report(%p)\n", report);
fprintf(stderr, "__tsan_get_current_report() = %p\n",

View File

@ -22,8 +22,13 @@ void f() {
h++;
}
// Required for dyld macOS 12.0+
#if (__APPLE__)
__attribute__((weak))
#endif
__attribute__((disable_sanitizer_instrumentation))
void __tsan_on_report() {
extern void
__tsan_on_report() {
fprintf(stderr, "Report.\n");
// Without these annotations this test deadlocks for COMPILER_RT_DEBUG=ON