Files
swift-mirror/test/IRGen/unknown_object.sil
Joe Groff 81ea860d89 IRGen: Builtin.UnknownObject should not be hardcoded to use ObjC refcounting.
It's more appropriate to use `Unknown` refcounting, which we correctly handle in the face of non-ObjC-interop elsewhere. Fixes a problem where the Linux standard library would contain an unresolvable reference to `objc_release`.
2017-07-07 09:52:09 -07:00

18 lines
591 B
Plaintext

// RUN: %target-swift-frontend -emit-ir %s | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-runtime %s
sil_stage canonical
import Builtin
// CHECK-LABEL: @retain_release_unknown_object
sil @retain_release_unknown_object : $@convention(thin) (@guaranteed Builtin.UnknownObject) -> () {
entry(%x : $Builtin.UnknownObject):
// CHECK-native: swift_retain
// CHECK-objc: swift_unknownRetain
%y = copy_value %x : $Builtin.UnknownObject
// CHECK-native: swift_release
// CHECK-objc: swift_unknownRelease
destroy_value %y : $Builtin.UnknownObject
return undef : $()
}