mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
18 lines
588 B
Plaintext
18 lines
588 B
Plaintext
// RUN: rm -rf %t && mkdir %t
|
|
// RUN: %build-irgen-test-overlays
|
|
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir | FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Swift
|
|
import Foundation
|
|
|
|
// CHECK-LABEL: define{{( protected)?}} %swift.error* @errortype_from_nserror(%CSo7NSError*)
|
|
// CHECK: %1 = bitcast %CSo7NSError* %0 to %swift.error*
|
|
sil @errortype_from_nserror : $@convention(thin) (@owned NSError) -> @owned ErrorProtocol {
|
|
entry(%0 : $NSError):
|
|
%1 = init_existential_ref %0 : $NSError : $NSError, $ErrorProtocol
|
|
return %1 : $ErrorProtocol
|
|
}
|
|
|