Skip to content

Commit 4e6eb51

Browse files
committed
[AddressLowering] Test: Added for arg behavior.
1 parent 93e209c commit 4e6eb51

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/SILOptimizer/address_lowering.sil

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,26 @@ block(%instance : @owned $any Error):
10701070
return %retval : $()
10711071
}
10721072

1073+
// CHECK-LABEL: sil [ossa] @f164_testOpenedArchetype2 : {{.*}} {
1074+
// CHECK: {{bb[0-9]+}}([[ERROR_EXI:%[^,]+]] :
1075+
// CHECK: [[ERROR_CONCR:%[^,]+]] = open_existential_box [[ERROR_EXI]]
1076+
// CHECK: [[STACK:%[^,]+]] = alloc_stack
1077+
// CHECK: copy_addr [[ERROR_CONCR]] to [init] [[STACK]]
1078+
// CHECK: destroy_addr [[STACK]]
1079+
// CHECK: dealloc_stack [[STACK]]
1080+
// CHECK-LABEL: } // end sil function 'f164_testOpenedArchetype2'
1081+
sil [ossa] @f164_testOpenedArchetype2 : $@convention(thin) (@guaranteed any Error) -> () {
1082+
bb0(%error_exi : @guaranteed $any Error):
1083+
%error_concr = open_existential_box_value %error_exi : $any Error to $@opened("F616C4D8-268F-11EE-998B-32F16C24A34D", any Error) Self
1084+
%stack = alloc_stack $@opened("F616C4D8-268F-11EE-998B-32F16C24A34D", any Error) Self
1085+
%error_copy = copy_value %error_concr : $@opened("F616C4D8-268F-11EE-998B-32F16C24A34D", any Error) Self
1086+
store %error_copy to [init] %stack : $*@opened("F616C4D8-268F-11EE-998B-32F16C24A34D", any Error) Self
1087+
destroy_addr %stack : $*@opened("F616C4D8-268F-11EE-998B-32F16C24A34D", any Error) Self
1088+
dealloc_stack %stack : $*@opened("F616C4D8-268F-11EE-998B-32F16C24A34D", any Error) Self
1089+
%tuple = tuple ()
1090+
return %tuple : $()
1091+
}
1092+
10731093
// CHECK-LABEL: sil [ossa] @f170_compare : $@convention(thin) <T where T : Comparable> (@in_guaranteed T, @in_guaranteed T) -> @out T {
10741094
// CHECK: bb0(%0 : $*T, %1 : $*T, %2 : $*T):
10751095
// CHECK: [[WT:%.*]] = witness_method $T, #Comparable."<" : <Self where Self : Comparable> (Self.Type) -> (Self, Self) -> Builtin.Int1 : $@convention(witness_method: Comparable) <τ_0_0 where τ_0_0 : Comparable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0, @thick τ_0_0.Type) -> Builtin.Int1

0 commit comments

Comments
 (0)