mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
573 B
Plaintext
21 lines
573 B
Plaintext
// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | FileCheck %s
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
import Swift
|
|
|
|
enum ColorError : ErrorProtocol {
|
|
case Red, Green, Blue
|
|
}
|
|
|
|
// CHECK-LABEL: TestCallToWillThrowCallBack
|
|
// CHECK-NOT: call void @swift_willThrow(%swift.error* %0)
|
|
// CHECK: ret i64 undef
|
|
sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned ErrorProtocol) -> (Int64, @error ErrorProtocol) {
|
|
bb0(%0 : $ErrorProtocol):
|
|
builtin "willThrow"(%0 : $ErrorProtocol) : $()
|
|
throw %0 : $ErrorProtocol // id: %3
|
|
}
|
|
|