Skip to content

Commit a3b46fc

Browse files
committed
[Test] Replaced hard-coded ids with patterns.
The test's correctness doesn't depend on the exact sequence of instructions. Use IDs to allow for other instructions to appear.
1 parent 31ab259 commit a3b46fc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/SILOptimizer/address_lowering.sil

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -938,20 +938,20 @@ bb0(%0 : @owned $P):
938938
}
939939

940940
// CHECK-LABEL: sil [ossa] @f161_testOpenedArchetype : $@convention(thin) (@in any P) -> () {
941-
// CHECK: bb0(%0 : $*any P):
941+
// CHECK: bb0([[INSTANCE:%[^,]+]] : $*any P):
942942
// CHECK: [[ALLOCP:%.*]] = alloc_stack $any P, var, name "q"
943-
// CHECK: copy_addr %0 to [init] [[ALLOCP]] : $*any P
944-
// CHECK: [[OPEN:%.*]] = open_existential_addr immutable_access %0 : $*any P to $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self
943+
// CHECK: copy_addr [[INSTANCE]] to [init] [[ALLOCP]] : $*any P
944+
// CHECK: [[OPEN:%.*]] = open_existential_addr immutable_access [[INSTANCE]] : $*any P to $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self
945945
// CHECK: [[OPTIONAL:%.*]] = alloc_stack $Optional<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>
946946
// CHECK: witness_method $@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self, #P.foo : <Self where Self : P> (Self) -> () -> (), [[OPEN]] : $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
947947
// CHECK: [[INIT:%.*]] = init_enum_data_addr [[OPTIONAL]] : $*Optional<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>, #Optional.some!enumelt
948948
// CHECK: copy_addr [[OPEN]] to [init] [[INIT]] : $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self
949949
// CHECK: inject_enum_addr [[OPTIONAL]] : $*Optional<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>, #Optional.some!enumelt
950950
// CHECK: [[DATA:%.*]] = unchecked_take_enum_data_addr [[OPTIONAL]] : $*Optional<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>, #Optional.some!enumelt
951-
// CHECK: %10 = apply %{{.*}}<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>([[DATA]]) : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
952-
// CHECK: destroy_addr %9 : $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self
951+
// CHECK: apply %{{.*}}<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>([[DATA]]) : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
952+
// CHECK: destroy_addr [[DATA:%[^,]+]] : $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self
953953
// CHECK: destroy_addr [[ALLOCP]] : $*any P
954-
// CHECK: destroy_addr %0 : $*any P
954+
// CHECK: destroy_addr [[INSTANCE]] : $*any P
955955
// CHECK: dealloc_stack [[OPTIONAL]] : $*Optional<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>
956956
// CHECK: dealloc_stack [[ALLOCP]] : $*any P
957957
// CHECK-LABEL: } // end sil function 'f161_testOpenedArchetype'

0 commit comments

Comments
 (0)