2 Test tailcall-generic-cast-il.il.
5 Jay Krell (jaykrell@microsoft.com)
7 Copyright 2018 Microsoft
8 Licensed under the MIT license. See LICENSE file in the project root for full license information.
10 This derived from nearby tailcall-generic-cast-cs.cs.
13 .assembly extern mscorlib { }
15 .assembly 'tailcall-generic-cast-conservestack-il' { }
21 .method public instance void .ctor ( )
24 tail. call instance void [mscorlib]System.Object::.ctor ( )
31 .field private static int32 i
33 .method public static void
34 check (int64 stack1, int64 stack2) noinlining
49 ldstr "{0} tailcall failure"
51 box [mscorlib]System.Int32
52 call void [mscorlib]System.Console::WriteLine (string, object)
54 tail. call void [mscorlib]System.Environment::Exit (int32)
59 .method public static !!T
60 cast1<T> (object o, int32 counter, int64 stack) noinlining
62 .locals init (int32 V_0)
75 tail. call !!0 C::cast1<!!0> (object, int32, int64)
83 call void C::check (int64, int64)
89 .method public static class B
90 cast2 (object o, int32 counter, int64 stack) noinlining
92 .locals init (int32 V_0)
105 tail. call class B C::cast2 (object, int32, int64)
113 call void C::check (int64, int64)
118 tail. call !!0 C::cast1<class B> (object, int32, int64)
122 .method public static !!T
123 cast3<T> (object o, int32 counter, int64 stack) noinlining
125 .locals init (int32 V_0)
138 tail. call !!0 C::cast3<!!0> (object, int32, int64)
146 call void C::check (int64, int64)
151 tail. call !!0 C::cast1<!!0> (object, int32, int64)
155 .method public static class B[]
156 cast4 (object o, int32 counter, int64 stack) noinlining
158 .locals init (int32 V_0)
171 tail. call class B[] C::cast4 (object, int32, int64)
179 call void C::check (int64, int64)
184 tail. call !!0 C::cast1<class B[]> (object, int32, int64)
188 .method public static !!T[]
189 cast5<T> (object o, int32 counter, int64 stack) noinlining
191 .locals init (int32 V_0)
204 tail. call !!0[] C::cast5<!!0> (object, int32, int64)
212 call void C::check (int64, int64)
217 tail. call !!0 C::cast1<!!0[]> (object, int32, int64)
222 .class public D`1<T1>
224 .method public static void
225 check (int64 stack1, int64 stack2) noinlining
229 tail. call void C::check (int64, int64)
233 .method public static !!T
234 cast1<T> (object o, int32 counter, int64 stack) noinlining
236 .locals init (int32 V_0)
249 tail. call !!0 class D`1<!T1>::cast1<!!0> (object, int32, int64)
257 call void class D`1<!T1>::check (int64, int64)
263 .method public static class B
264 cast2 (object o, int32 counter, int64 stack) noinlining
266 .locals init (int32 V_0)
279 tail. call class B class D`1<!T1>::cast2 (object, int32, int64)
287 call void class D`1<!T1>::check (int64, int64)
292 tail. call !!0 class D`1<!T1>::cast1<class B> (object, int32, int64)
296 .method public static !!T
297 cast3<T> (object o, int32 counter, int64 stack) noinlining
299 .locals init (int32 V_0)
312 tail. call !!0 class D`1<!T1>::cast3<!!0> (object, int32, int64)
320 call void class D`1<!T1>::check (int64, int64)
325 tail. call !!0 class D`1<!T1>::cast1<!!0> (object, int32, int64)
329 .method public static class B[]
330 cast4 (object o, int32 counter, int64 stack) noinlining
332 .locals init (int32 V_0)
345 tail. call class B[] class D`1<!T1>::cast4 (object, int32, int64)
353 call void class D`1<!T1>::check (int64, int64)
358 tail. call !!0 class D`1<!T1>::cast1<class B[]> (object, int32, int64)
362 .method public static !!T[]
363 cast5<T> (object o, int32 counter, int64 stack) noinlining
365 .locals init (int32 V_0)
378 tail. call !!0[] class D`1<!T1>::cast5<!!0> (object, int32, int64)
386 call void class D`1<!T1>::check (int64, int64)
391 tail. call !!0 class D`1<!T1>::cast1<!!0[]> (object, int32, int64)
395 .method public static !T1
396 cast6 (object o, int32 counter, int64 stack) noinlining
398 .locals init (int32 V_0)
411 tail. call !0 class D`1<!T1>::cast6 (object, int32, int64)
419 call void class D`1<!T1>::check (int64, int64)
424 tail. call !!0 class D`1<!T1>::cast1<!0> (object, int32, int64)
428 .method public static !T1
429 cast7<T> (object o, int32 counter, int64 stack) noinlining
431 .locals init (int32 V_0)
444 tail. call !0 class D`1<!T1>::cast7<!!0> (object, int32, int64)
452 call void class D`1<!T1>::check (int64, int64)
457 tail. call !!0 class D`1<!T1>::cast1<!0> (object, int32, int64)
461 .method public static !T1[]
462 cast8 (object o, int32 counter, int64 stack) noinlining
464 .locals init (int32 V_0)
477 tail. call !0[] class D`1<!T1>::cast8 (object, int32, int64)
485 call void class D`1<!T1>::check (int64, int64)
490 tail. call !!0 class D`1<!T1>::cast3<!0[]> (object, int32, int64)
494 .method public static !T1[]
495 cast9<T> (object o, int32 counter, int64 stack) noinlining
497 .locals init (int32 V_0)
510 tail. call !0[] class D`1<!T1>::cast9<!!0> (object, int32, int64)
518 call void class D`1<!T1>::check (int64, int64)
523 tail. call !!0 class D`1<!T1>::cast3<!0[]> (object, int32, int64)
528 instance void .ctor ( )
531 tail. call instance void [mscorlib]System.Object::.ctor ( )
538 .field private static int32 i
540 .method private static void
541 print (object o) noinlining
550 .method public static void
551 Main (string[] args) noinlining
555 newobj instance void B::.ctor ( )
559 call class B C::cast2 (object, int32, int64)
560 call void E::print (object)
562 newobj instance void B::.ctor ( )
566 call !!0 C::cast3<class B> (object, int32, int64)
567 call void E::print (object)
574 call !!0 C::cast3<class B[]> (object, int32, int64)
575 call void E::print (object)
582 call class B[] C::cast4 (object, int32, int64)
583 call void E::print (object)
590 call !!0[] C::cast5<class B> (object, int32, int64)
591 call void E::print (object)
593 newobj instance void B::.ctor ( )
597 call class B class D`1<class A>::cast2 (object, int32, int64)
598 call void E::print (object)
600 newobj instance void B::.ctor ( )
604 call !!0 class D`1<class A>::cast3<class B> (object, int32, int64)
605 call void E::print (object)
612 call !!0 class D`1<class A>::cast3<class B[]> (object, int32, int64)
613 call void E::print (object)
620 call class B[] class D`1<class A>::cast4 (object, int32, int64)
621 call void E::print (object)
628 call !!0[] class D`1<class A>::cast5<class B> (object, int32, int64)
629 call void E::print (object)
631 newobj instance void B::.ctor ( )
635 call !0 class D`1<class B>::cast6 (object, int32, int64)
636 call void E::print (object)
638 newobj instance void B::.ctor ( )
642 call !0 class D`1<class B>::cast7<class A> (object, int32, int64)
643 call void E::print (object)
650 call !0 class D`1<class B[]>::cast7<class A[]> (object, int32, int64)
651 call void E::print (object)
658 call !0[] class D`1<class B>::cast8 (object, int32, int64)
659 call void E::print (object)
667 call !0[] class D`1<class B>::cast9<class A> (object, int32, int64)
668 call void E::print (object)