[TSan][libdispatch] Guard test execution on old platforms
authorJulian Lettner <julian.lettner@apple.com>
Fri, 14 Aug 2020 20:42:50 +0000 (13:42 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Wed, 19 Aug 2020 01:34:14 +0000 (18:34 -0700)
commit40ae296bc39a2780ec4cd99edd87cce35585b9ad
tree409071b6f8317ef004825e98bdf64f901d9acd65
parent686fe293e6c5fd51fa0a3c86a43c2d9a652d53b1
[TSan][libdispatch] Guard test execution on old platforms

`dispatch_async_and_wait()` was introduced in macOS 10.14.  Let's
forward declare it to ensure we can compile the test with older SDKs and
guard execution by checking if the symbol is available.  (We can't use
`__builtin_available()`, because that itself requires a higher minimum
deployment target.)  We also need to specify the `-undefined
dynamic_lookup` compiler flag.

Differential Revision: https://reviews.llvm.org/D85995
compiler-rt/test/tsan/libdispatch/async_and_wait.c