Files
swift-mirror/test/SIL/Parser/ownership_qualified_memopts.sil
Michael Gottesman bb9197c7ff [semantic-arc] Move the Ownership Model Eliminator and management of SILFunction::hasQualifiedOwnership in front of SILOptions::EnableSILOwnership.
This is a NFC change, since verification still will be behind the flag. But this
will allow me to move copy_value, destroy_value in front of the
EnableSILOwnership flag and verify via SILGen that we are always using those
instructions.

rdar://28851920
2016-10-23 18:30:43 -07:00

32 lines
1.5 KiB
Plaintext

// We run this through sil-opt twice to test parsing -> printing -> parsing -> printing
// RUN: %target-sil-opt %s | %target-sil-opt | %FileCheck %s
import Builtin
// CHECK-LABEL: sil @non_trivial : $@convention(thin) (@in Builtin.NativeObject, Builtin.NativeObject) -> () {
// CHECK: bb0([[ARG1:%[0-9]+]] : $*Builtin.NativeObject, [[ARG2:%[0-9]+]] : $Builtin.NativeObject):
// CHECK: load [take] [[ARG1]] : $*Builtin.NativeObject
// CHECK: load [copy] [[ARG1]] : $*Builtin.NativeObject
// CHECK: store [[ARG2]] to [init] [[ARG1]] : $*Builtin.NativeObject
// CHECK: store [[ARG2]] to [assign] [[ARG1]] : $*Builtin.NativeObject
sil @non_trivial : $@convention(thin) (@in Builtin.NativeObject, Builtin.NativeObject) -> () {
bb0(%0 : $*Builtin.NativeObject, %1 : $Builtin.NativeObject):
load [take] %0 : $*Builtin.NativeObject
load [copy] %0 : $*Builtin.NativeObject
store %1 to [init] %0 : $*Builtin.NativeObject
store %1 to [assign] %0 : $*Builtin.NativeObject
%2 = tuple()
return %2 : $()
}
// CHECK-LABEL: sil @trivial : $@convention(thin) (@in Builtin.Int32, Builtin.Int32) -> () {
// CHECK: bb0([[ARG1:%[0-9]+]] : $*Builtin.Int32, [[ARG2:%[0-9]+]] : $Builtin.Int32):
// CHECK: load [trivial] [[ARG1]] : $*Builtin.Int32
// CHECK: store [[ARG2]] to [trivial] [[ARG1]] : $*Builtin.Int32
sil @trivial : $@convention(thin) (@in Builtin.Int32, Builtin.Int32) -> () {
bb0(%0 : $*Builtin.Int32, %1 : $Builtin.Int32):
load [trivial] %0 : $*Builtin.Int32
store %1 to [trivial] %0 : $*Builtin.Int32
%2 = tuple()
return %2 : $()
}