mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
I also had to fix up one test and eliminated a test that did not really make sense in the first place to test with ossa. (Specifically, copy_value_destroy_value is a test I added when adding copy_value, destroy_value, it really doesn't make sense since we will just lower it to retain, release before we hit IRGen).
21 lines
621 B
Plaintext
21 lines
621 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 [ossa] @retain_release_unknown_object : $@convention(thin) (@guaranteed Builtin.AnyObject) -> () {
|
|
entry(%x : @guaranteed $Builtin.AnyObject):
|
|
// CHECK-native: swift_retain
|
|
// CHECK-objc: swift_unknownObjectRetain
|
|
%y = copy_value %x : $Builtin.AnyObject
|
|
br bb1
|
|
|
|
bb1:
|
|
// CHECK-native: swift_release
|
|
// CHECK-objc: swift_unknownObjectRelease
|
|
destroy_value %y : $Builtin.AnyObject
|
|
return undef : $()
|
|
}
|