Files
swift-mirror/test/SIL/Parser/borrow_argument.sil
Michael Gottesman 0a4618e93e [semantic-sil] Implement parsing and printing of ownership attributes on SILArguments.
This is only enabled when semantic sil is enabled /and/ we are not parsing
unqualified SIL.

*NOTE* To properly write tests for this, I had to rework how we verified
Branch/CondBranch insts to be actually correct (instead of pseudo-correct). I
have to put this functionality together in order to write tests.

rdar://29791263
2017-01-22 22:02:31 -08:00

20 lines
688 B
Plaintext

// RUN: %target-sil-opt -enable-sil-ownership %s | %target-sil-opt -enable-sil-ownership | %FileCheck %s
sil_stage canonical
import Builtin
// CHECK-LABEL: sil @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
// CHECK: bb1([[PHIBBARG:%.*]] : @guaranteed $Builtin.NativeObject):
// CHECK: end_borrow_argument [[PHIBBARG]] : $Builtin.NativeObject
sil @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
bb0(%0 : @guaranteed $Builtin.NativeObject):
br bb1(%0 : $Builtin.NativeObject)
bb1(%1 : @guaranteed $Builtin.NativeObject):
end_borrow_argument %1 : $Builtin.NativeObject
%4 = tuple()
return %4 : $()
}