Skip to content

Commit 0cd5906

Browse files
committed
[Test] Update a few failing tests
1 parent 7244f6c commit 0cd5906

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

test/ModuleInterface/property_wrappers.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public struct HasWrappers {
4444
// CHECK: @TestResilient.Wrapper public var x: {{(Swift.)?}}Int {
4545
// CHECK-NEXT: get
4646
// CHECK-NEXT: set
47+
// CHECK-NEXT: _modify
4748
// CHECK-NEXT: }
4849
@Wrapper public var x: Int
4950

@@ -59,6 +60,7 @@ public struct HasWrappers {
5960
// CHECK: @TestResilient.WrapperWithInitialValue @_projectedValueProperty($z) public var z: Swift.Bool {
6061
// CHECK-NEXT: get
6162
// CHECK-NEXT: set
63+
// CHECK-NEXT: _modify
6264
// CHECK-NEXT: }
6365
@WrapperWithInitialValue(alternate: false) public var z
6466
}

test/SILGen/property_wrapper_coroutine.swift

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ struct State1: StateProtocol {
1919

2020
var state = State()
2121
state.values = Array(repeating: "", count: 20000)
22-
// CHECK: [[BEGIN_ACCESS_MODIFY:%.*]] = begin_access [modify] [dynamic] {{%.*}} : $*State
23-
// CHECK: [[REF_MODIFY:%.*]] = function_ref @$s26property_wrapper_coroutine5StateV6valuesSaySSGvM : $@yield_once @convention(method) (@inout State) -> @yields @inout Array<String>
24-
// CHECK: ([[RES1:%.*]], {{%.*}}) = begin_apply [[REF_MODIFY]]([[BEGIN_ACCESS_MODIFY]]) : $@yield_once @convention(method) (@inout State) -> @yields @inout Array<String>
22+
state.values[1000] = "foo"
23+
24+
let state1 = State1()
25+
_ = state1.someValues
26+
27+
// >> Check that the subscript assignment uses the _modify coroutine
28+
29+
// CHECK: {{%.*}} = begin_access [modify] [dynamic] {{%.*}} : $*State
30+
// CHECK: [[REF_VALUES_MODIFY:%.*]] = function_ref @$s26property_wrapper_coroutine5StateV6valuesSaySSGvM : $@yield_once @convention(method) (@inout State) -> @yields @inout Array<String>
31+
// CHECK: ([[RES1:%.*]], {{%.*}}) = begin_apply [[REF_VALUES_MODIFY]]({{%.*}}) : $@yield_once @convention(method) (@inout State) -> @yields @inout Array<String>
2532
// CHECK: [[REF_ARRAY_SUBSCRIPT:%.*]] = function_ref @$sSayxSiciM : $@yield_once @convention(method) <τ_0_0> (Int, @inout Array<τ_0_0>) -> @yields @inout τ_0_0
2633
// CHECK: ({{%.*}}, {{%.*}}) = begin_apply [[REF_ARRAY_SUBSCRIPT]]<String>({{%.*}}, [[RES1]]) : $@yield_once @convention(method) <τ_0_0> (Int, @inout Array<τ_0_0>) -> @yields @inout τ_0_0
27-
state.values[1000] = "foo"
34+
35+
// >> Check that the _modify coroutine is synthesized properly
2836

2937
// CHECK-LABEL: sil hidden [transparent] [ossa] @$s26property_wrapper_coroutine5StateV6valuesSaySSGvM : $@yield_once @convention(method) (@inout State) -> @yields @inout Array<String> {
3038
// CHECK: bb0([[STATE:%.*]] : $*State):
@@ -44,15 +52,14 @@ state.values[1000] = "foo"
4452
// CHECK: unwind
4553
// CHECK-END: }
4654

47-
var state1 = State1()
48-
_ = state1.someValues
55+
// >> Check that the _read coroutine is synthesized properly
4956

5057
// CHECK-LABEL: sil shared [ossa] @$s26property_wrapper_coroutine6State1V10someValuesSaySSGvr : $@yield_once @convention(method) (@guaranteed State1) -> @yields @guaranteed Array<String> {
5158
// CHECK: bb0([[STATE1:%.*]] : @guaranteed $State1):
5259
// CHECK: debug_value [[SELF:%.*]] : $State1, let, name "self", argno {{.*}}
5360
// CHECK: [[EXTRACT_VALUE:%.*]] = struct_extract %0 : $State1, #State1._someValues
5461
// CHECK: [[COPY_VALUE:%.*]] = copy_value [[EXTRACT_VALUE]] : $TestWrapper<Array<String>>
55-
// CHECK: [[BEGIN_BORROW:%.*]] = begin_borrow [[COPY]] : $TestWrapper<Array<String>>
62+
// CHECK: [[BEGIN_BORROW:%.*]] = begin_borrow [[COPY_VALUE]] : $TestWrapper<Array<String>>
5663
// CHECK: [[EXTRACT_WRAPPEDVALUE:%.*]] = struct_extract [[BEGIN_BORROW]] : $TestWrapper<Array<String>>, #TestWrapper.wrappedValue
5764
// CHECK: yield [[EXTRACT_WRAPPEDVALUE]] : $Array<String>, resume bb1, unwind bb2
5865
//

test/decl/var/property_wrappers_synthesis.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct UseWrapper<T: DefaultInit> {
2121

2222
// CHECK: accessor_decl{{.*}}_modify_for=wrapped
2323
// CHECK: yield_stmt
24-
// CHECK: member_ref_expr{{.*}}UseWrapper.wrapped
24+
// CHECK: member_ref_expr{{.*}}Wrapper.wrappedValue
2525
@Wrapper
2626
var wrapped = T()
2727

0 commit comments

Comments
 (0)