The build scripts assume Android cross-compilation using the NDK, so avoid
that configuration if building on an Android host. Fix or disable some tests,
and don't install a glibc.modulemap without a native sysroot prefix.
1) Enable tests that use `import Dispatch` on Linux. Add substitution
`%import-libdispatch` that needs to be used for all cross-platform
tests (i.e., tests that are intended to be run on other platforms
than Darwin) that do `import Dispatch` or enable thread sanitizer.
2) Make sure as many existing Dispatch and TSan tests as possible run on
Linux. Mark tests that would require substantial work with
`UNSUPPORTED: OS=linux-gnu`.
3) Add integration-style Swift test that shows that TSan finds a simple
race when using `Dispatch.async` incorrectly. A more complete test
suite for TSan's libdispatch support lives on the LLVM/compiler-rt
side.
rdar://problem/49177535
The lit feature `objc_interop` is used as a proxy for the availability
of libdispatch and Foundation.
Although we don't support Obj-C on non-Apple platforms, we support
libdispatch and Foundation. Let's break up `objc_interop` into
finer-grained categories so we can run more tests on non-Apple
platforms.
This patch adds lit features `libdispatch` and `foundation` (currently
only enabled on Apple platforms) and removes the `objc_interop`
dependency from libdispatch tests.
This converts the instances of the pattern for which we have a proper
substitution in lit. This will make it easier to replace it
appropriately with Windows equivalents.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.
Swift SVN r22745