Files
swift-mirror/test/IRGen/unknown_object.sil
Michael Gottesman 451252d42f [sil] Add a run of ownership model eliminator in the lowering pass pipeline to ensure we eliminate ownership even if a bisecting counter has disabled the normal ome run.
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).
2019-10-24 18:26:15 -07:00

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 : $()
}