Files
swift-mirror/test/IRGen/errors_optimized.sil
Michael Gottesman fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00

21 lines
525 B
Plaintext

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