@@ -33,48 +33,48 @@ ArchetypeToArchetype(t: d, t2: c)
33
33
ArchetypeToArchetype ( t: c, t2: e)
34
34
ArchetypeToArchetype ( t: b, t2: f)
35
35
36
- // x -> x where x is not a class .
37
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8_S____TF37specialize_unconditional_checked_cast20ArchetypeToArchetype {{.*}} : $@convention(thin) (@out UInt8 , @in UInt8, @in UInt8 ) -> () {
36
+ // x -> y where x and y are unrelated non classes .
37
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8_Vs6UInt64___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype {{.*}} : $@convention(thin) (@out UInt64 , @in UInt8, @in UInt64 ) -> () {
38
38
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
39
-
40
- // x -> x where x is a class.
41
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_S0____TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out C, @in C, @in C) -> () {
39
+ // CHECK-NOT: unconditional_checked_cast archetype_to_archetype
40
+ // CHECK: builtin "int_trap"
42
41
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
43
42
44
- // x -> y where x is not a class but y is.
45
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8_C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out C, @in UInt8, @in C) -> () {
46
- // CHECK-NOT: unconditional_checked_cast_addr
47
- // CHECK-NOT: unconditional_checked_cast_addr
48
- // CHECK: builtin "int_trap"
49
- // CHECK-NOT: unconditional_checked_cast_addr
50
-
51
- // y -> x where x is not a class but y is.
52
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_Vs5UInt8___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out UInt8, @in C, @in UInt8) -> () {
43
+ // x -> y where x and y are unrelated classes.
44
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_CS_1E___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out E, @in C, @in E) -> () {
53
45
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
54
46
// CHECK: builtin "int_trap"
55
47
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
56
48
57
- // x -> y where x is a super class of y.
58
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_CS_1D___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out D, @in C, @in D) -> () {
59
- // CHECK: unconditional_checked_cast_addr take_always C in %1 : $*C to D in
60
-
61
49
// y -> x where x is a super class of y.
62
50
// CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D_CS_1C___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out C, @in D, @in C) -> () {
63
51
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
64
52
// CHECK: upcast {{%[0-9]+}} : $D to $C
65
53
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
66
54
67
- // x -> y where x and y are unrelated classes.
68
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_CS_1E___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out E, @in C, @in E) -> () {
55
+ // x -> y where x is a super class of y.
56
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_CS_1D___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out D, @in C, @in D) -> () {
57
+ // CHECK: unconditional_checked_cast_addr take_always C in %1 : $*C to D in
58
+
59
+ // y -> x where x is not a class but y is.
60
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_Vs5UInt8___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out UInt8, @in C, @in UInt8) -> () {
69
61
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
70
62
// CHECK: builtin "int_trap"
71
63
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
72
64
73
- // x -> y where x and y are unrelated non classes.
74
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8_Vs6UInt64___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out UInt64, @in UInt8, @in UInt64) -> () {
75
- // CHECK-NOT: unconditional_checked_cast archetype_to_archetype
65
+ // x -> y where x is not a class but y is.
66
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8_C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out C, @in UInt8, @in C) -> () {
67
+ // CHECK-NOT: unconditional_checked_cast_addr
68
+ // CHECK-NOT: unconditional_checked_cast_addr
69
+ // CHECK: builtin "int_trap"
70
+ // CHECK-NOT: unconditional_checked_cast_addr
71
+
72
+ // x -> x where x is a class.
73
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C_S0____TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out C, @in C, @in C) -> () {
76
74
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
77
- // CHECK: builtin "int_trap"
75
+
76
+ // x -> x where x is not a class.
77
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8_S____TF37specialize_unconditional_checked_cast20ArchetypeToArchetype{{.*}} : $@convention(thin) (@out UInt8, @in UInt8, @in UInt8) -> () {
78
78
// CHECK-NOT: unconditional_checked_cast archetype_to_archetype
79
79
80
80
@@ -90,26 +90,29 @@ ArchetypeToConcreteConvertUInt8(t: b)
90
90
ArchetypeToConcreteConvertUInt8 ( t: c)
91
91
ArchetypeToConcreteConvertUInt8 ( t: f)
92
92
93
+ // order 57%
93
94
// x -> x where x is not a class.
94
95
// CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast31ArchetypeToConcreteConvertUInt8{{.*}} : $@convention(thin) (@in UInt8) -> UInt8 {
95
96
// CHECK: bb0
96
97
// CHECK-NEXT: debug_value_addr
97
98
// CHECK-NEXT: load
98
99
// CHECK-NEXT: return
99
100
100
- // x -> x where x is a class.
101
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC{{.*}} : $@convention(thin) (@in C) -> @owned C {
101
+ // order: 59%
102
+ // x -> y where x,y are classes and x is a super class of y.
103
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC{{.*}} : $@convention(thin) (@in D) -> @owned C {
102
104
// CHECK: bb0
103
105
// CHECK-NEXT: debug_value_addr
104
106
// CHECK-NEXT: load
107
+ // CHECK-NEXT: upcast
105
108
// CHECK-NEXT: return
106
109
107
- // x -> y where x,y are classes and x is a super class of y.
108
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC{{.*}} : $@convention(thin) (@in D) -> @owned C {
110
+ // order: 60%
111
+ // x -> x where x is a class.
112
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC{{.*}} : $@convention(thin) (@in C) -> @owned C {
109
113
// CHECK: bb0
110
114
// CHECK-NEXT: debug_value_addr
111
115
// CHECK-NEXT: load
112
- // CHECK-NEXT: upcast
113
116
// CHECK-NEXT: return
114
117
115
118
@@ -164,13 +167,12 @@ ConcreteToArchetypeConvertUInt8(t: b, t2: b)
164
167
ConcreteToArchetypeConvertUInt8 ( t: b, t2: c)
165
168
ConcreteToArchetypeConvertUInt8 ( t: b, t2: f)
166
169
167
- // x -> x where x is not a class.
168
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast31ConcreteToArchetypeConvertUInt8 {{.*}} : $@convention(thin) (@out UInt8 , UInt8, @in UInt8 ) -> () {
170
+ // x -> y where x,y are different non class types .
171
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs6UInt64___TF37specialize_unconditional_checked_cast31ConcreteToArchetypeConvertUInt8 {{.*}} : $@convention(thin) (@out UInt64 , UInt8, @in UInt64 ) -> () {
169
172
// CHECK: bb0
170
- // CHECK-NEXT: debug_value
171
- // CHECK-NEXT: store
172
- // CHECK-NEXT: tuple
173
- // CHECK-NEXT: return
173
+ // CHECK: builtin "int_trap"
174
+ // CHECK: unreachable
175
+ // CHECK-NEXT: }
174
176
175
177
// x -> y where x is not a class but y is a class.
176
178
// CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast31ConcreteToArchetypeConvertUInt8{{.*}} : $@convention(thin) (@out C, UInt8, @in C) -> () {
@@ -179,12 +181,13 @@ ConcreteToArchetypeConvertUInt8(t: b, t2: f)
179
181
// CHECK: unreachable
180
182
// CHECK-NEXT: }
181
183
182
- // x -> y where x,y are different non class types .
183
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs6UInt64___TF37specialize_unconditional_checked_cast31ConcreteToArchetypeConvertUInt8 {{.*}} : $@convention(thin) (@out UInt64 , UInt8, @in UInt64 ) -> () {
184
+ // x -> x where x is not a class.
185
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast31ConcreteToArchetypeConvertUInt8 {{.*}} : $@convention(thin) (@out UInt8 , UInt8, @in UInt8 ) -> () {
184
186
// CHECK: bb0
185
- // CHECK: builtin "int_trap"
186
- // CHECK: unreachable
187
- // CHECK-NEXT: }
187
+ // CHECK-NEXT: debug_value
188
+ // CHECK-NEXT: store
189
+ // CHECK-NEXT: tuple
190
+ // CHECK-NEXT: return
188
191
189
192
@inline ( never)
190
193
public func ConcreteToArchetypeConvertC< T> ( t t: C , t2: T ) -> T {
@@ -196,15 +199,26 @@ ConcreteToArchetypeConvertC(t: c, t2: b)
196
199
ConcreteToArchetypeConvertC ( t: c, t2: d)
197
200
ConcreteToArchetypeConvertC ( t: c, t2: e)
198
201
202
+ // x -> y where x and y are unrelated classes.
203
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1E___TF37specialize_unconditional_checked_cast27ConcreteToArchetypeConvertC{{.*}} : $@convention(thin) (@out E, @owned C, @in E) -> () {
204
+ // CHECK: bb0
205
+ // CHECK-NEXT: builtin "int_trap"
206
+ // CHECK: unreachable
207
+ // CHECK-NEXT: }
199
208
200
- // x -> x where x is a class.
201
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast27ConcreteToArchetypeConvertC {{.*}} : $@convention(thin) (@out C , @owned C, @in C ) -> () {
209
+ // x -> y where x is a super class of y .
210
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast27ConcreteToArchetypeConvertC {{.*}} : $@convention(thin) (@out D , @owned C, @in D ) -> () {
202
211
// CHECK: bb0
203
212
// CHECK-NEXT: debug_value
204
213
// CHECK-NEXT: debug_value_addr
214
+ // CHECK-NEXT: alloc_stack
205
215
// CHECK-NEXT: store
216
+ // CHECK-NEXT: strong_retain
217
+ // CHECK-NEXT: unconditional_checked_cast_addr take_always
218
+ // CHECK-NEXT: dealloc_stack
206
219
// CHECK-NEXT: load
207
220
// CHECK-NEXT: strong_release
221
+ // CHECK-NEXT: strong_release
208
222
// CHECK-NEXT: tuple
209
223
// CHECK-NEXT: return
210
224
@@ -215,30 +229,17 @@ ConcreteToArchetypeConvertC(t: c, t2: e)
215
229
// CHECK: unreachable
216
230
// CHECK-NEXT: }
217
231
218
- // x -> y where x is a super class of y .
219
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast27ConcreteToArchetypeConvertC {{.*}} : $@convention(thin) (@out D , @owned C, @in D ) -> () {
232
+ // x -> x where x is a class.
233
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast27ConcreteToArchetypeConvertC {{.*}} : $@convention(thin) (@out C , @owned C, @in C ) -> () {
220
234
// CHECK: bb0
221
235
// CHECK-NEXT: debug_value
222
236
// CHECK-NEXT: debug_value_addr
223
- // CHECK-NEXT: alloc_stack
224
237
// CHECK-NEXT: store
225
- // CHECK-NEXT: strong_retain
226
- // CHECK-NEXT: unconditional_checked_cast_addr take_always
227
- // CHECK-NEXT: dealloc_stack
228
238
// CHECK-NEXT: load
229
239
// CHECK-NEXT: strong_release
230
- // CHECK-NEXT: strong_release
231
240
// CHECK-NEXT: tuple
232
241
// CHECK-NEXT: return
233
242
234
- // x -> y where x and y are unrelated classes.
235
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1E___TF37specialize_unconditional_checked_cast27ConcreteToArchetypeConvertC{{.*}} : $@convention(thin) (@out E, @owned C, @in E) -> () {
236
- // CHECK: bb0
237
- // CHECK-NEXT: builtin "int_trap"
238
- // CHECK-NEXT: store undef to %0 : $*E
239
- // CHECK: unreachable
240
- // CHECK-NEXT: }
241
-
242
243
@inline ( never)
243
244
public func ConcreteToArchetypeConvertD< T> ( t t: D , t2: T ) -> T {
244
245
return t as! T
@@ -272,6 +273,17 @@ SuperToArchetypeC(c: c, t: c)
272
273
SuperToArchetypeC ( c: c, t: d)
273
274
SuperToArchetypeC ( c: c, t: b)
274
275
276
+ // x -> y where x is a class and y is not.
277
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast17SuperToArchetypeC{{.*}} : $@convention(thin) (@out UInt8, @owned C, @in UInt8) -> () {
278
+ // CHECK: bb0
279
+ // CHECK: builtin "int_trap"
280
+ // CHECK: unreachable
281
+ // CHECK-NEXT: }
282
+
283
+ // x -> y where x is a super class of y.
284
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast17SuperToArchetypeC{{.*}} : $@convention(thin) (@out D, @owned C, @in D) -> () {
285
+ // CHECK: bb0
286
+ // CHECK: unconditional_checked_cast_addr take_always C in
275
287
276
288
// x -> x where x is a class.
277
289
// CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast17SuperToArchetypeC{{.*}} : $@convention(thin) (@out C, @owned C, @in C) -> () {
@@ -284,18 +296,6 @@ SuperToArchetypeC(c: c, t: b)
284
296
// CHECK-NEXT: tuple
285
297
// CHECK-NEXT: return
286
298
287
- // x -> y where x is a super class of y.
288
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast17SuperToArchetypeC{{.*}} : $@convention(thin) (@out D, @owned C, @in D) -> () {
289
- // CHECK: bb0
290
- // CHECK: unconditional_checked_cast_addr take_always C in
291
-
292
- // x -> y where x is a class and y is not.
293
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast17SuperToArchetypeC{{.*}} : $@convention(thin) (@out UInt8, @owned C, @in UInt8) -> () {
294
- // CHECK: bb0
295
- // CHECK: builtin "int_trap"
296
- // CHECK: unreachable
297
- // CHECK-NEXT: }
298
-
299
299
@inline ( never)
300
300
public func SuperToArchetypeD< T> ( d d : D , t : T ) -> T {
301
301
return d as! T
@@ -304,13 +304,6 @@ public func SuperToArchetypeD<T>(d d : D, t : T) -> T {
304
304
SuperToArchetypeD ( d: d, t: c)
305
305
SuperToArchetypeD ( d: d, t: d)
306
306
307
- // *NOTE* The frontend is smart enough to turn this into an upcast. When this
308
- // test is converted to SIL, this should be fixed appropriately.
309
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast17SuperToArchetypeD{{.*}} : $@convention(thin) (@out C, @owned D, @in C) -> () {
310
- // CHECK-NOT: unconditional_checked_cast super_to_archetype
311
- // CHECK: upcast
312
- // CHECK-NOT: unconditional_checked_cast super_to_archetype
313
-
314
307
// CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1D___TF37specialize_unconditional_checked_cast17SuperToArchetypeD{{.*}} : $@convention(thin) (@out D, @owned D, @in D) -> () {
315
308
// CHECK: bb0
316
309
// CHECK-NEXT: debug_value
@@ -321,6 +314,13 @@ SuperToArchetypeD(d: d, t: d)
321
314
// CHECK-NEXT: tuple
322
315
// CHECK-NEXT: return
323
316
317
+ // *NOTE* The frontend is smart enough to turn this into an upcast. When this
318
+ // test is converted to SIL, this should be fixed appropriately.
319
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast17SuperToArchetypeD{{.*}} : $@convention(thin) (@out C, @owned D, @in C) -> () {
320
+ // CHECK-NOT: unconditional_checked_cast super_to_archetype
321
+ // CHECK: upcast
322
+ // CHECK-NOT: unconditional_checked_cast super_to_archetype
323
+
324
324
//////////////////////////////
325
325
// Existential To Archetype //
326
326
//////////////////////////////
@@ -330,16 +330,6 @@ public func ExistentialToArchetype<T>(o o : AnyObject, t : T) -> T {
330
330
return o as! T
331
331
}
332
332
333
- // AnyObject -> Class.
334
- // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast22ExistentialToArchetype{{.*}} : $@convention(thin) (@out C, @owned AnyObject, @in C) -> () {
335
- // CHECK: unconditional_checked_cast_addr take_always AnyObject in {{%.*}} : $*AnyObject to C
336
-
337
- // AnyObject -> Non Class (should always fail)
338
- // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast22ExistentialToArchetype{{.*}} : $@convention(thin) (@out UInt8, @owned AnyObject, @in UInt8) -> () {
339
- // CHECK: builtin "int_trap"()
340
- // CHECK: unreachable
341
- // CHECK-NEXT: }
342
-
343
333
// AnyObject -> AnyObject
344
334
// CHECK-LABEL: sil shared [noinline] @_TTSg5Ps9AnyObject____TF37specialize_unconditional_checked_cast22ExistentialToArchetype{{.*}} : $@convention(thin) (@out AnyObject, @owned AnyObject, @in AnyObject) -> () {
345
335
// CHECK: bb0
@@ -351,6 +341,16 @@ public func ExistentialToArchetype<T>(o o : AnyObject, t : T) -> T {
351
341
// CHECK-NEXT: tuple
352
342
// CHECK-NEXT: return
353
343
344
+ // AnyObject -> Non Class (should always fail)
345
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast22ExistentialToArchetype{{.*}} : $@convention(thin) (@out UInt8, @owned AnyObject, @in UInt8) -> () {
346
+ // CHECK: builtin "int_trap"()
347
+ // CHECK: unreachable
348
+ // CHECK-NEXT: }
349
+
350
+ // AnyObject -> Class.
351
+ // CHECK-LABEL: sil shared [noinline] @_TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast22ExistentialToArchetype{{.*}} : $@convention(thin) (@out C, @owned AnyObject, @in C) -> () {
352
+ // CHECK: unconditional_checked_cast_addr take_always AnyObject in {{%.*}} : $*AnyObject to C
353
+
354
354
ExistentialToArchetype ( o: o, t: c)
355
355
ExistentialToArchetype ( o: o, t: b)
356
356
ExistentialToArchetype ( o: o, t: o)
@@ -370,34 +370,39 @@ public func callGenericDownCast(c: C?) -> D {
370
370
return genericDownCast ( c, D . self)
371
371
}
372
372
373
+ //order: -5
373
374
// x -> y where y is a class but x is not.
374
375
// CHECK-LABEL: sil shared [noinline] @_TTSf4d___TTSg5C37specialize_unconditional_checked_cast1C___TF37specialize_unconditional_checked_cast31ArchetypeToConcreteConvertUInt8
375
376
// CHECK: bb0
376
377
// CHECK: builtin "int_trap"
377
378
// CHECK: unreachable
378
379
// CHECK-NEXT: }
379
380
381
+ //order: -4
380
382
// x -> y where x,y are not classes and x is a different type from y.
381
383
// CHECK-LABEL: sil shared [noinline] @_TTSf4d___TTSg5Vs6UInt64___TF37specialize_unconditional_checked_cast31ArchetypeToConcreteConvertUInt8
382
384
// CHECK: bb0
383
385
// CHECK: builtin "int_trap"
384
386
// CHECK: unreachable
385
387
// CHECK-NEXT: }
386
388
389
+ // order -3
387
390
// x -> y where x is a class but y is not.
388
391
// CHECK-LABEL: sil shared [noinline] @_TTSf4d___TTSg5Vs5UInt8___TF37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC
389
392
// CHECK: bb0
390
393
// CHECK: builtin "int_trap"
391
394
// CHECK: unreachable
392
395
// CHECK-NEXT: }
393
396
397
+ // order -2
394
398
// x -> y where x,y are classes, but x is unrelated to y.
395
399
// CHECK-LABEL: sil shared [noinline] @_TTSf4d___TTSg5C37specialize_unconditional_checked_cast1E___TF37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC
396
400
// CHECK: bb0
397
401
// CHECK: builtin "int_trap"
398
402
// CHECK: unreachable
399
403
// CHECK-NEXT: }
400
404
405
+ // order -1
401
406
// x -> y where x,y are classes, but y is unrelated to x. The idea is
402
407
// to make sure that the fact that y is concrete does not affect the
403
408
// result.
0 commit comments