Files
swift-mirror/test/Interpreter/async_dynamic_replacement.swift
Arnold Schwaighofer 1f890dc6a2 IRGen: Fix async dynamic replacements
We need to emit a full async suspend sequence when calling the
replacement.

rdar://77072724
2021-04-23 09:03:51 -07:00

27 lines
644 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -Xfrontend -enable-experimental-concurrency %s -parse-as-library -module-name main -o %t/main
// RUN: %target-codesign %t/main
// RUN: %target-run %t/main | %FileCheck %s
// REQUIRES: concurrency
// REQUIRES: executable_test
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
public dynamic func number() async -> Int {
return 100
}
@_dynamicReplacement(for: number())
internal func _replacement_number() async -> Int {
return 200
}
@main struct Main {
static func main() async {
// CHECK: 200
let value = await number()
print(value)
}
}