Files
swift-mirror/test/stdlib/run_inline_die.swift
Nate Chandler 34c08b8344 [TaskToThread] Add Task.runInline.
The new intrinsic, exposed via static functions on Task<T, Never> and
Task<T, Error> (rethrowing), begins an asynchronous context within a
synchronous caller's context.  This is only available for use under the
task-to-thread concurrency model, and even then only under SPI.
2022-07-08 08:44:18 -07:00

22 lines
611 B
Swift

// RUN: %target-build-swift -parse-as-library -Xfrontend -disable-availability-checking -module-name a %s -o %t.out
// RUN: %target-codesign %t.out
// RUN: %target-run %t.out
// REQUIRES: executable_test
// REQUIRES: freestanding
// REQUIRES: concurrency
// REQUIRES: concurrency_runtime
// This test should always exit with a non-zero code.
// XFAIL: *
@_spi(_TaskToThreadModel) import _Concurrency
@main struct Main {
static func main() async {
// Check that we crash when calling runInline from within an async context--
// here the async context of an async @main.
Task.runInline {}
}
}