Skip to content

Commit

Permalink
[TSan][Darwin] Additional TSAN test requiring weak symbol for dyld64
Browse files Browse the repository at this point in the history
Tests require a weak symbol for dyld weak-def coalescing.

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

Adding additional weak attribute
  • Loading branch information
Blue Gaston authored and Blue Gaston committed Jul 29, 2022
1 parent 2c82a12 commit cea1b79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler-rt/test/tsan/cxa_guard_acquire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

namespace __tsan {

#if (__APPLE__)
__attribute__((weak))
#endif
void OnPotentiallyBlockingRegionBegin() {
printf("Enter __cxa_guard_acquire\n");
}

#if (__APPLE__)
__attribute__((weak))
#endif
void OnPotentiallyBlockingRegionEnd() { printf("Exit __cxa_guard_acquire\n"); }

} // namespace __tsan
Expand Down
3 changes: 3 additions & 0 deletions compiler-rt/test/tsan/default_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include <pthread.h>
#include <stdio.h>

#if (__APPLE__)
__attribute__((weak))
#endif
extern "C" const char *__tsan_default_options() {
return "report_bugs=0";
}
Expand Down

0 comments on commit cea1b79

Please sign in to comment.