Skip to content

Commit 067efb1

Browse files
committed
[Test] Stopped passing wrong flag.
Previously, ShrinkBorrowScope was only run alongside CanonicalizeBorrowScope under the flag -canonical-ossa-rewrite-borrows. That is no longer so, so remove that flag. Update a test case to undo the canonicalization which CanonicalizeBorrowScope was previously doing.
1 parent 21069bb commit 067efb1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/SILOptimizer/shrink_borrow_scope.sil

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -copy-propagation -canonical-ossa-rewrite-borrows -enable-sil-verify-all %s | %FileCheck %s
1+
// RUN: %target-sil-opt -copy-propagation -enable-sil-verify-all %s | %FileCheck %s
22

33
import Builtin
44
import Swift
@@ -408,12 +408,13 @@ exit:
408408
// CHECK-LABEL: sil [ossa] @hoist_over_struct : {{.*}} {
409409
// CHECK: {{bb[0-9]+}}([[INSTANCE_C:%[^,]+]] : @owned $C, [[INSTANCE_D:%[^,]+]] : @owned $D):
410410
// CHECK: [[LIFETIME_C:%[^,]+]] = begin_borrow [[INSTANCE_C]]
411+
// CHECK: [[COPY_C:%[^,]+]] = copy_value [[LIFETIME_C]]
411412
// CHECK: [[LIFETIME_D:%[^,]+]] = begin_borrow [[INSTANCE_D]]
412413
// CHECK: [[REGISTER_4:%[^,]+]] = struct $CDCase ([[LIFETIME_C]] : $C, [[LIFETIME_D]] : $D)
413414
// CHECK: end_borrow [[LIFETIME_C]]
414415
// CHECK: end_borrow [[LIFETIME_D]]
415416
// CHECK: destroy_value [[INSTANCE_D]]
416-
// CHECK: return [[INSTANCE_C]]
417+
// CHECK: return [[COPY_C]]
417418
// CHECK-LABEL: } // end sil function 'hoist_over_struct'
418419
sil [ossa] @hoist_over_struct : $@convention(thin) (@owned C, @owned D) -> @owned C {
419420
entry(%instance_c: @owned $C, %instance_d: @owned $D):

0 commit comments

Comments
 (0)