mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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`.
18 lines
591 B
Plaintext
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 : $()
|
|
}
|