tsan: disable instrumentation in runtime callbacks in tests

All runtime callbacks must be non-instrumented with the new tsan runtime
(it's now more picky with respect to recursion into runtime).
Disable instrumentation in Darwin tests as we do in all other tests now.

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

GitOrigin-RevId: e69d50d9ff3e2608c2153c8e54b5044e05a0c34d
diff --git a/test/tsan/Darwin/debug_external.cpp b/test/tsan/Darwin/debug_external.cpp
index 2418a27..399663c 100644
--- a/test/tsan/Darwin/debug_external.cpp
+++ b/test/tsan/Darwin/debug_external.cpp
@@ -42,7 +42,8 @@
   return 0;
 }
 
-void __tsan_on_report(void *report) {
+__attribute__((disable_sanitizer_instrumentation)) void
+__tsan_on_report(void *report) {
   const char *type;
   void *addr;
   void *start;
diff --git a/test/tsan/Darwin/external-swift-debugging.cpp b/test/tsan/Darwin/external-swift-debugging.cpp
index 603734e..72335ed 100644
--- a/test/tsan/Darwin/external-swift-debugging.cpp
+++ b/test/tsan/Darwin/external-swift-debugging.cpp
@@ -45,8 +45,8 @@
   fprintf(stderr, "Done.\n");
 }
 
-extern "C"
-void __tsan_on_report(void *report) {
+extern "C" __attribute__((disable_sanitizer_instrumentation)) void
+__tsan_on_report(void *report) {
   const char *description;
   int count;
   int stack_count, mop_count, loc_count, mutex_count, thread_count,