@@ -950,8 +950,8 @@ bb0(%0 : @owned $P):
950
950
// CHECK-LABEL: sil [ossa] @f161_testOpenedArchetype : $@convention(thin) (@in any P) -> () {
951
951
// CHECK: bb0(%0 : $*any P):
952
952
// CHECK: [[ALLOCP:%.*]] = alloc_stack $any P, var, name "q"
953
- // CHECK: copy_addr %0 to [init] [[ALLOCP]] : $*any P
954
953
// CHECK: debug_value %0 : $*any P, var, name "q"
954
+ // CHECK: copy_addr %0 to [init] [[ALLOCP]] : $*any P
955
955
// CHECK: [[OPEN:%.*]] = open_existential_addr immutable_access %0 : $*any P to $*@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self
956
956
// CHECK: [[OPTIONAL:%.*]] = alloc_stack $Optional<@opened("EF755EF2-B636-11E7-B7B4-A45E60ECC541", any P) Self>
957
957
// 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) -> ()
@@ -1901,6 +1901,29 @@ exit:
1901
1901
return %retval : $()
1902
1902
}
1903
1903
1904
+ // CHECK-LABEL: sil hidden [ossa] @test_store_1 : {{.*}} {
1905
+ // CHECK: [[MAYBE_ADDR:%[^,]+]] = alloc_stack $Optional<Self>
1906
+ // CHECK: [[LOAD_ADDR:%[^,]+]] = alloc_stack $Self
1907
+ // CHECK: [[ADDR:%[^,]+]] = alloc_stack $Self, var, name "self"
1908
+ // CHECK: [[INSTANCE_ADDR:%[^,]+]] = unchecked_take_enum_data_addr [[MAYBE_ADDR]] : $*Optional<Self>, #Optional.some!enumelt
1909
+ // CHECK: debug_value [[INSTANCE_ADDR]] : $*Self, var, name "self", expr op_deref
1910
+ // CHECK: copy_addr [take] [[INSTANCE_ADDR]] to [init] [[ADDR]]
1911
+ // CHECK: copy_addr [[ADDR]] to [init] [[LOAD_ADDR]]
1912
+ // CHECK-LABEL: } // end sil function 'test_store_1'
1913
+ sil hidden [ossa] @test_store_1 : $@convention(thin) <Self> () -> () {
1914
+ bb0:
1915
+ %addr = alloc_stack $Self, var, name "self"
1916
+ %maybe = apply undef<Self>() : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
1917
+ %instance = unchecked_enum_data %maybe : $Optional<Self>, #Optional.some!enumelt
1918
+ store %instance to [init] %addr : $*Self
1919
+ %load = load [copy] %addr : $*Self
1920
+ destroy_addr %addr : $*Self
1921
+ dealloc_stack %addr : $*Self
1922
+ destroy_value %load : $Self
1923
+ %retval = tuple ()
1924
+ return %retval : $()
1925
+ }
1926
+
1904
1927
// CHECK-LABEL: sil hidden [ossa] @test_unchecked_bitwise_cast :
1905
1928
// CHECK: bb0(%0 : $*U, %1 : $*T, %2 : $@thick U.Type):
1906
1929
// CHECK: [[STK:%.*]] = alloc_stack $T
0 commit comments