Files
swift-mirror/test/IRGen/objc_errors.sil
Michael Gottesman be568902f2 [ownership] Always print out ownership argument annotations whether or not -enable-sil-ownership is passed in.
This is how we originally controlled whether or not we printed out ownership
annotations when we printed SIL. Since then, I have changed (a few months ago I
believe) the ownership model eliminator to know how to eliminate these
annotations from the SIL itself. So this hack can be removed.

As an additional benefit, this will let me rename -enable-sil-ownership to
-enable-sil-ownership-verifier. This will I hope eliminate confusion around this
option in the short term while I am preparing to work on semantic sil again.

rdar://42509812
2018-07-24 13:18:37 -07:00

18 lines
598 B
Plaintext

// RUN: %empty-directory(%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{{( dllexport)?}}{{( protected)?}} swiftcc %swift.error* @errortype_from_nserror(%TSo7NSErrorC*)
// CHECK: %1 = bitcast %TSo7NSErrorC* %0 to %swift.error*
sil @errortype_from_nserror : $@convention(thin) (@owned NSError) -> @owned Error {
entry(%0 : @owned $NSError):
%1 = init_existential_ref %0 : $NSError : $NSError, $Error
return %1 : $Error
}