mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
14 lines
843 B
Swift
14 lines
843 B
Swift
// RUN: %swift -typecheck -target i386-apple-watchos2.0 -verify -sdk %sdk %s
|
|
// REQUIRES: CPU=i386, OS=watchos
|
|
// REQUIRES: libdispatch
|
|
|
|
import Dispatch
|
|
|
|
// These are deprecated on all versions of watchOS.
|
|
_ = DispatchQueue.GlobalQueuePriority.high // expected-warning {{'high' is deprecated in watchOS: Use qos attributes instead}}
|
|
_ = DispatchQueue.GlobalQueuePriority.default // expected-warning {{'default' is deprecated in watchOS: Use qos attributes instead}}
|
|
_ = DispatchQueue.GlobalQueuePriority.low // expected-warning {{'low' is deprecated in watchOS: Use qos attributes instead}}
|
|
let b = DispatchQueue.GlobalQueuePriority.background // expected-warning {{'background' is deprecated in watchOS: Use qos attributes instead}}
|
|
|
|
_ = DispatchQueue.global(priority:b) // expected-warning {{'global(priority:)' is deprecated in watchOS}}
|