mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
45 lines
1.6 KiB
Plaintext
45 lines
1.6 KiB
Plaintext
// RUN: %target-sil-opt %s \
|
|
// RUN: -enable-library-evolution \
|
|
// RUN: -enable-experimental-feature CoroutineAccessors \
|
|
// RUN: | %FileCheck %s
|
|
|
|
// REQUIRES: swift_feature_CoroutineAccessors
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
|
|
struct Int {
|
|
var _value: Builtin.Int64
|
|
}
|
|
|
|
open class B {
|
|
open var i: Int { read set }
|
|
}
|
|
|
|
sil @B_i_read : $@yield_once @convention(method) (@guaranteed B) -> @yields Int
|
|
sil @B_i_read2 : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields Int
|
|
sil @B_i_set : $@convention(method) (Int, @guaranteed B) -> ()
|
|
sil @B_i_modify : $@yield_once @convention(method) (@guaranteed B) -> @yields @inout Int
|
|
sil @B_i_modify2 : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int
|
|
|
|
sil_vtable B {
|
|
#B.i!read: (B) -> () -> () : @B_i_read
|
|
#B.i!read2: (B) -> () -> () : @B_i_read2
|
|
#B.i!setter: (B) -> (Int) -> () : @B_i_set
|
|
#B.i!modify: (B) -> () -> () : @B_i_modify
|
|
#B.i!modify2: (B) -> () -> () : @B_i_modify2
|
|
}
|
|
|
|
sil @B_i_read2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields Int
|
|
sil @B_i_modify2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int
|
|
|
|
// CHECK-LABEL: sil_default_override_table B {
|
|
// CHECK-NEXT: #B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override
|
|
// CHECK-NEXT: #B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override
|
|
// CHECK-NEXT: }
|
|
sil_default_override_table B {
|
|
#B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override
|
|
#B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override
|
|
}
|