| // 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 |
| } |
| |