Skip to content

Commit 0f6765b

Browse files
committed
fix test case for 32-bit platforms
1 parent 54903d2 commit 0f6765b

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

test/SILOptimizer/existential_type_propagation.sil

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ bb0:
110110
}
111111

112112
protocol P {
113-
func foo() -> Int
113+
func foo() -> Int64
114114
}
115115

116116
struct X : P {
117-
var xx : Int
118-
func foo() -> Int
117+
var xx : Int64
118+
func foo() -> Int64
119119
}
120120

121121
// CHECK-LABEL: sil @promote_over_control_flow
@@ -125,13 +125,13 @@ struct X : P {
125125
// CHECK-NEXT: apply
126126
// CHECK-NOT: open_existential_addr
127127
// CHECK: return
128-
sil @promote_over_control_flow : $@convention(thin) () -> Int {
128+
sil @promote_over_control_flow : $@convention(thin) () -> Int64 {
129129
bb0:
130130
%2 = alloc_stack $P, let, name "p"
131131
%3 = init_existential_addr %2 : $*P, $X
132132
%6 = integer_literal $Builtin.Int64, 27
133-
%7 = struct $Int (%6 : $Builtin.Int64)
134-
%8 = struct $X (%7 : $Int)
133+
%7 = struct $Int64 (%6 : $Builtin.Int64)
134+
%8 = struct $X (%7 : $Int64)
135135
store %8 to %3 : $*X
136136
cond_br undef, bb1, bb2
137137

@@ -140,55 +140,55 @@ bb1:
140140

141141
bb2:
142142
%10 = open_existential_addr %2 : $*P to $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P
143-
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
144-
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
143+
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
144+
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
145145
destroy_addr %2 : $*P
146146
dealloc_stack %2 : $*P
147-
return %12 : $Int
147+
return %12 : $Int64
148148
}
149149

150150
// CHECK-LABEL: sil @existential_is_overwritten_by_store
151151
// CHECK: open_existential_addr
152152
// CHECK-NEXT: witness_method
153153
// CHECK-NEXT: apply
154-
sil @existential_is_overwritten_by_store : $@convention(thin) (P) -> Int {
154+
sil @existential_is_overwritten_by_store : $@convention(thin) (P) -> Int64 {
155155
bb0(%0 : $P):
156156
%2 = alloc_stack $P, let, name "p"
157157
%3 = init_existential_addr %2 : $*P, $X
158158
%6 = integer_literal $Builtin.Int64, 27
159-
%7 = struct $Int (%6 : $Builtin.Int64)
160-
%8 = struct $X (%7 : $Int)
159+
%7 = struct $Int64 (%6 : $Builtin.Int64)
160+
%8 = struct $X (%7 : $Int64)
161161
store %8 to %3 : $*X
162162
destroy_addr %2 : $*P
163163
store %0 to %2 : $*P
164164
%10 = open_existential_addr %2 : $*P to $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P
165-
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
166-
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
165+
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
166+
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
167167
dealloc_stack %2 : $*P
168-
return %12 : $Int
168+
return %12 : $Int64
169169
}
170170

171171
// CHECK-LABEL: sil @existential_is_overwritten_by_call
172172
// CHECK: open_existential_addr
173173
// CHECK-NEXT: witness_method
174174
// CHECK-NEXT: apply
175175
// CHECK: return
176-
sil @existential_is_overwritten_by_call : $@convention(thin) () -> Int {
176+
sil @existential_is_overwritten_by_call : $@convention(thin) () -> Int64 {
177177
bb0:
178178
%2 = alloc_stack $P, let, name "p"
179179
%3 = init_existential_addr %2 : $*P, $X
180180
%6 = integer_literal $Builtin.Int64, 27
181-
%7 = struct $Int (%6 : $Builtin.Int64)
182-
%8 = struct $X (%7 : $Int)
181+
%7 = struct $Int64 (%6 : $Builtin.Int64)
182+
%8 = struct $X (%7 : $Int64)
183183
store %8 to %3 : $*X
184184
destroy_addr %2 : $*P
185185
%f = function_ref @write_p : $@convention(thin) (@out P) -> ()
186186
%a = apply %f(%2) : $@convention(thin) (@out P) -> ()
187187
%10 = open_existential_addr %2 : $*P to $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P
188-
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
189-
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
188+
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
189+
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
190190
dealloc_stack %2 : $*P
191-
return %12 : $Int
191+
return %12 : $Int64
192192
}
193193

194194
// CHECK-LABEL: sil @existential_is_not_overwritten_by_call
@@ -197,29 +197,29 @@ bb0:
197197
// CHECK-NEXT: apply
198198
// CHECK-NOT: open_existential_addr
199199
// CHECK: return
200-
sil @existential_is_not_overwritten_by_call : $@convention(thin) () -> Int {
200+
sil @existential_is_not_overwritten_by_call : $@convention(thin) () -> Int64 {
201201
bb0:
202202
%2 = alloc_stack $P, let, name "p"
203203
%3 = init_existential_addr %2 : $*P, $X
204204
%6 = integer_literal $Builtin.Int64, 27
205-
%7 = struct $Int (%6 : $Builtin.Int64)
206-
%8 = struct $X (%7 : $Int)
205+
%7 = struct $Int64 (%6 : $Builtin.Int64)
206+
%8 = struct $X (%7 : $Int64)
207207
store %8 to %3 : $*X
208208
%f = function_ref @read_p : $@convention(thin) (@in P) -> ()
209209
%a = apply %f(%2) : $@convention(thin) (@in P) -> ()
210210
%10 = open_existential_addr %2 : $*P to $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P
211-
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
212-
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int
211+
%11 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P, #P.foo!1, %10 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
212+
%12 = apply %11<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P>(%10) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
213213
destroy_addr %2 : $*P
214214
dealloc_stack %2 : $*P
215-
return %12 : $Int
215+
return %12 : $Int64
216216
}
217217

218218
sil @write_p : $@convention(thin) (@out P) -> ()
219219

220220
sil @read_p : $@convention(thin) (@in P) -> ()
221221

222-
sil @foo_witness : $@convention(witness_method) (@in_guaranteed X) -> Int
222+
sil @foo_witness : $@convention(witness_method) (@in_guaranteed X) -> Int64
223223

224224
sil_witness_table hidden X: P module nix {
225225
method #P.foo!1: @foo_witness

0 commit comments

Comments
 (0)