Skip to content

Commit 4369c9c

Browse files
committed
[NFC] Update test with return_borrow
1 parent 01680de commit 4369c9c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/SILGen/borrow_accessor_evolution.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN:%target-swift-frontend -emit-silgen %s -verify -enable-experimental-feature BorrowAndMutateAccessors -enable-library-evolution | %FileCheck %s
2+
// RUN:%target-swift-frontend -c -Xllvm -sil-print-after=SILGenCleanup %s -verify -enable-experimental-feature BorrowAndMutateAccessors -enable-library-evolution 2>&1 | %FileCheck --check-prefixes=CHECK-SILGEN-CLEANUP %s
23

34
// REQUIRES: swift_feature_BorrowAndMutateAccessors
45

@@ -136,6 +137,13 @@ func test() {
136137
// CHECK: return [[REG4]]
137138
// CHECK: }
138139

140+
// CHECK-SILGEN-CLEANUP: sil hidden [ossa] @$s25borrow_accessor_evolution7WrapperV1kAA5KlassCvb : $@convention(method) (@in_guaranteed Wrapper) -> @guaranteed Klass {
141+
// CHECK-SILGEN-CLEANUP: bb0([[REG0:%.*]] : $*Wrapper):
142+
// CHECK-SILGEN-CLEANUP: [[REG2:%.*]] = struct_element_addr [[REG0]], #Wrapper._k
143+
// CHECK-SILGEN-CLEANUP: [[REG3:%.*]] = load_borrow [[REG2]]
144+
// CHECK-SILGEN-CLEANUP: return_borrow [[REG3]] from_scopes ([[REG3]])
145+
// CHECK-SILGEN-CLEANUP: }
146+
139147
// CHECK-LABEL: sil hidden [ossa] @$s25borrow_accessor_evolution7WrapperV7nested1AA5KlassCvb : $@convention(method) (@in_guaranteed Wrapper) -> @guaranteed Klass {
140148
// CHECK: bb0([[REG0:%.*]] : $*Wrapper):
141149
// CHECK: debug_value [[REG0]], let, name "self", argno 1, expr op_deref
@@ -164,6 +172,13 @@ func test() {
164172
// CHECK: return [[REG6]]
165173
// CHECK: }
166174

175+
// CHECK-SILGEN-CLEANUP: sil hidden [ossa] @$s25borrow_accessor_evolution7WrapperVyAA5KlassCSicib : $@convention(method) (Int, @in_guaranteed Wrapper) -> @guaranteed Klass {
176+
// CHECK-SILGEN-CLEANUP: bb0([[REG0:%.*]] : $Int, [[REG1:%.*]] : $*Wrapper):
177+
// CHECK-SILGEN-CLEANUP: [[REG4:%.*]] = struct_element_addr [[REG1]], #Wrapper._k
178+
// CHECK-SILGEN-CLEANUP: [[REG5:%.*]] = load_borrow [[REG4]]
179+
// CHECK-SILGEN-CLEANUP: return_borrow [[REG5]] from_scopes ([[REG5]])
180+
// CHECK-SILGEN-CLEANUP: }
181+
167182
// CHECK-LABEL: sil hidden [ossa] @$s25borrow_accessor_evolution7WrapperV16nested_subscriptAA5KlassCvb : $@convention(method) (@in_guaranteed Wrapper) -> @guaranteed Klass {
168183
// CHECK: bb0([[REG0:%.*]] : $*Wrapper):
169184
// CHECK: debug_value [[REG0]], let, name "self", argno 1, expr op_deref

0 commit comments

Comments
 (0)