mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Refactor SILGen's ApplyOptions into an OptionSet, add a DoesNotAwait flag to go with DoesNotThrow, and sink it all down into SILInstruction.h. Then, replace the isNonThrowing() flag in ApplyInst and BeginApplyInst with getApplyOptions(), and plumb it through to TryApplyInst as well. Set the flag when SILGen emits a sync call to a reasync function. When set, this disables the SIL verifier check against calling async functions from sync functions. Finally, this allows us to add end-to-end tests for rdar://problem/71098795.
23 lines
812 B
Plaintext
23 lines
812 B
Plaintext
// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-sil-opt %s -emit-sib -o %t/tmp.sib -module-name async
|
|
// RUN: %target-sil-opt %t/tmp.sib -module-name async | %FileCheck %s
|
|
// REQUIRES: concurrency
|
|
|
|
import Builtin
|
|
import Swift
|
|
import _Concurrency
|
|
|
|
// CHECK: sil [serialized] @noasync_callee : $@convention(thin) @async () -> ()
|
|
sil [serialized] @noasync_callee : $@convention(thin) @async () -> ()
|
|
|
|
// CHECK: sil [serialized] @noasync_apply : $@convention(thin) () -> () {
|
|
sil [serialized] @noasync_apply : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = function_ref @noasync_callee : $@convention(thin) @async () -> ()
|
|
// CHECK: apply [noasync] %0
|
|
%1 = apply [noasync] %0() : $@convention(thin) @async () -> ()
|
|
return undef : $()
|
|
}
|
|
|