mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
34 lines
1.7 KiB
Plaintext
34 lines
1.7 KiB
Plaintext
// RUN: %target-sil-opt %s | %target-sil-opt | %FileCheck %s
|
|
|
|
import Builtin
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_copy_release_value
|
|
// CHECK: bb0([[T0:%[0-9]+]] : @owned $Builtin.NativeObject):
|
|
// CHECK-NEXT: [[COPY_RESULT:%.*]] = copy_value [[T0]] : $Builtin.NativeObject
|
|
// CHECK-NEXT: destroy_value [[T0]] : $Builtin.NativeObject
|
|
// CHECK-NEXT: return [[COPY_RESULT]]
|
|
sil [ossa] @test_copy_release_value : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
|
|
bb0(%0 : @owned $Builtin.NativeObject):
|
|
%1 = copy_value %0 : $Builtin.NativeObject
|
|
destroy_value %0 : $Builtin.NativeObject
|
|
return %1 : $Builtin.NativeObject
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_strong_copy_unowned_value : $@convention(thin) (@owned @sil_unowned Builtin.NativeObject) -> @owned Builtin.NativeObject {
|
|
// CHECK: bb0([[T0:%[0-9]+]] : @owned $@sil_unowned Builtin.NativeObject):
|
|
// CHECK-NEXT: [[COPY_RESULT:%.*]] = strong_copy_unowned_value [[T0]] : $@sil_unowned Builtin.NativeObject
|
|
// CHECK-NEXT: destroy_value [[T0]] : $@sil_unowned Builtin.NativeObject
|
|
// CHECK-NEXT: return [[COPY_RESULT]] : $Builtin.NativeObject
|
|
sil [ossa] @test_strong_copy_unowned_value : $@convention(thin) (@owned @sil_unowned Builtin.NativeObject) -> @owned Builtin.NativeObject {
|
|
bb0(%0 : @owned $@sil_unowned Builtin.NativeObject):
|
|
%1 = strong_copy_unowned_value %0 : $@sil_unowned Builtin.NativeObject
|
|
destroy_value %0 : $@sil_unowned Builtin.NativeObject
|
|
return %1 : $Builtin.NativeObject
|
|
}
|
|
|
|
sil [ossa] @strong_copy_unmanaged_value_test : $@convention(thin) (@sil_unmanaged Builtin.NativeObject) -> @owned Builtin.NativeObject {
|
|
bb0(%0 : $@sil_unmanaged Builtin.NativeObject):
|
|
%1 = strong_copy_unmanaged_value %0 : $@sil_unmanaged Builtin.NativeObject
|
|
return %1 : $Builtin.NativeObject
|
|
}
|