Files
swift-mirror/test/SIL/Serialization/basic.sil
2017-03-02 17:17:17 -08:00

25 lines
1.1 KiB
Plaintext

// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
// RUN: rm -rfv %t
// RUN: mkdir %t
// RUN: %target-sil-opt %s -emit-sib -o %t/tmp.sib -module-name borrow
// RUN: %target-sil-opt %t/tmp.sib -o %t/tmp.2.sib -module-name borrow
// RUN: %target-sil-opt %t/tmp.2.sib -module-name borrow | %FileCheck %s
import Builtin
// CHECK-LABEL: sil @test_unchecked_ownership_conversion : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
// CHECK: unchecked_ownership_conversion {{%.*}} : $Builtin.NativeObject, @guaranteed to @owned
sil @test_unchecked_ownership_conversion : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
bb0(%0 : $Builtin.NativeObject):
unchecked_ownership_conversion %0 : $Builtin.NativeObject, @guaranteed to @owned
return undef : $()
}
// CHECK-LABEL: sil @test_end_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
// CHECK: end_lifetime {{%.*}} : $Builtin.NativeObject
sil @test_end_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
bb0(%0 : $Builtin.NativeObject):
end_lifetime %0 : $Builtin.NativeObject
return undef : $()
}