blob: 0f126ed13ddbd2c007ede5529c0e91b01aab7e58 [file] [log] [blame]
// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | FileCheck %s
sil_stage canonical
import Builtin
import Swift
enum ColorError : ErrorType {
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 ErrorType) -> (Int64, @error ErrorType) {
bb0(%0 : $ErrorType):
builtin "willThrow"(%0 : $ErrorType) : $()
throw %0 : $ErrorType // id: %3
}