blob: 3becfc807a584f8a388901328210ad999b98adc8 [file] [log] [blame]
// RUN: %target-sil-opt -ownership-dumper %s -o /dev/null | %FileCheck %s
sil_stage canonical
import Builtin
class Klass {}
// CHECK-LABEL: Dumping Function: 'foo'
// CHECK: Visiting: %1 = unchecked_ref_cast %0 : $Builtin.NativeObject to $Klass
// CHECK: Ownership Constraint:
// CHECK: Op #: 0
// CHECK: Constraint: <Constraint Kind:owned LifetimeConstraint:LifetimeEnding>
// CHECK: Results Ownership Kinds:
// CHECK: Result: %1 = unchecked_ref_cast %0 : $Builtin.NativeObject to $Klass
// CHECK: Kind: owned
// CHECK: Visiting: return %1 : $Klass
// CHECK: Ownership Constraint:
// CHECK: Op #: 0
// CHECK: Constraint: <Constraint Kind:owned LifetimeConstraint:LifetimeEnding>
sil [ossa] @foo : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Klass {
bb0(%0 : @owned $Builtin.NativeObject):
%1 = unchecked_ref_cast %0 : $Builtin.NativeObject to $Klass
return %1 : $Klass
}