Skip to content

Commit 0ecd831

Browse files
[test] enable async_task_sleep.swift for non-libdispatch global executor
1 parent f00cf74 commit 0ecd831

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/Concurrency/Runtime/async_task_sleep.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-concurrency -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always
22
// REQUIRES: executable_test
33
// REQUIRES: concurrency
4-
// REQUIRES: libdispatch
54

65
// rdar://76038845
76
// REQUIRES: concurrency_runtime
87
// UNSUPPORTED: back_deployment_runtime
98

109
import _Concurrency
10+
#if canImport(Dispatch)
1111
// FIXME: should not depend on Dispatch
1212
import Dispatch
13+
#endif
1314

1415
@available(SwiftStdlib 5.5, *)
1516
@main struct Main {
@@ -21,6 +22,7 @@ import Dispatch
2122
}
2223

2324
static func testSleepDuration() async {
25+
#if canImport(Dispatch)
2426
let start = DispatchTime.now()
2527

2628
await Task.sleep(UInt64(pause))
@@ -29,6 +31,7 @@ import Dispatch
2931

3032
// assert that at least the specified time passed since calling `sleep`
3133
assert(stop >= (start + .nanoseconds(pause)))
34+
#endif
3235
}
3336

3437
static func testSleepDoesNotBlock() async {

0 commit comments

Comments
 (0)