2008-11-17 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / iltests.il.in
1 .assembly iltests {}
2 .assembly extern TestDriver {}
3 .assembly extern mscorlib {}
4
5 .class public auto ansi sealed beforefieldinit Tests {
6
7         .method static public int32 Main(string[] args) il managed {
8                 .entrypoint
9                 
10                 ldtoken Tests
11                 call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
12                 ldarg.0
13                 call       int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type, string[])
14                 ret
15         }
16
17         // make sure the register allocator works when the return value of
18         // 'div' is discarded
19         .method static public int32 test_0_div_regalloc () il managed {
20                 .locals init (
21                         int32 i
22                 )
23
24                 ldloc 0
25                 ldc.i4.s 0xa
26                 div
27                 pop
28                 ldc.i4.0
29                 ret
30         }
31         
32         
33         .method static public int32 test_1_ceq_to_i4 () il managed {
34                 .locals init (
35                         int32   foo
36                 )
37                 ldc.i4 500
38                 stloc foo
39                 ldloc foo
40                 ldc.i4 500
41                 ceq
42                 stloc foo
43                 ldloc foo
44                 ret
45         }
46         
47         .method static public int32 test_3_shl_regvars () il managed {
48                 .locals init (
49                         int32   a,
50                         int32   b,
51                         int32   r1,
52                         int32   r2,
53                         int32   r3
54                 )
55                         
56                 ldc.i4.2
57                 stloc      a
58                 ldc.i4.1
59                 stloc      b
60         
61                 ldloc      a
62                 ldloc      b
63                 shl 
64                 stloc      r1
65                 
66                 ldloc      a
67                 ldloc      b
68                 shl 
69                 stloc      r2
70                 
71                 ldloc      a
72                 ldloc      b
73                 shl 
74                 stloc      r3
75                 
76                 ldloc      r1
77                 ldc.i4.4
78                 ceq
79                 
80                 ldloc      r2
81                 ldc.i4.4
82                 ceq
83                 
84                 ldloc      r3
85                 ldc.i4.4
86                 ceq
87                 
88                 add
89                 add
90                 
91                 ret
92         }
93         
94         .method static public int32 test_1_fceq_to_i4 () il managed {
95         
96                 .locals init (
97                         float64 foo,
98                         int32   val
99                 )
100
101                 ldc.r8      2
102                 stloc       foo
103                 
104                 ldloc       foo
105                 ldc.r8      2
106                 ceq
107                 stloc       val
108                 
109                 ldloc       val
110                 ret
111         }
112
113         //
114         // This should be manually checked. Basically under -O=linears,
115         // you should not see tons of register spilling.
116         //
117         .method static public int32 test_1_bytedreg_free () il managed {
118                 .locals init (
119                         int32   foo
120                 )
121                 ldc.i4 500
122                 stloc foo
123                 ldloc foo
124                 ldc.i4 500
125                 ceq
126                 stloc foo
127                 
128                 ldloc foo
129                 ldc.i4 1
130                 ceq
131                 stloc foo
132
133                 ldloc foo
134                 ldc.i4 1
135                 ceq
136                 stloc foo
137
138                 ldloc foo
139                 ldc.i4 1
140                 ceq
141                 stloc foo
142                 
143                 ldloc foo
144                 ldc.i4 1
145                 ceq
146                 stloc foo
147                 
148                 ldloc foo
149                 ret
150         }
151         
152         //
153         // This should be manually checked. Basically under -O=linears,
154         // you should not see tons of register spilling.
155         //
156         .method static public int32 test_0_bytesreg1_free () il managed {
157                 .locals init (
158                         unsigned int8      dest,
159                         int32              src,
160                         unsigned int8&     pdest
161                 )
162
163                 ldloca     dest
164                 stloc      pdest
165                 
166                 ldloc      pdest
167                 ldloc      src
168                 stind.i1
169                 
170                 ldloc      pdest
171                 ldloc      src
172                 stind.i1
173                 
174                 ldloc      pdest
175                 ldloc      src
176                 stind.i1
177                 
178                 ldloc      pdest
179                 ldloc      src
180                 stind.i1
181                 
182                 ldloc      pdest
183                 ldloc      src
184                 stind.i1
185                 
186                 ldloc      pdest
187                 ldloc      src
188                 stind.i1
189                 
190                 ldloc      pdest
191                 ldind.i1
192                 ret
193         }
194         
195         .method static public int32 test_1_shift_regvar () il managed {
196         
197                 .locals init (
198                         int32   v7FFFFFFF,
199                         int32   v1
200                 )
201                 
202                 ldc.i4  0x7FFFFFFF
203                 stloc   v7FFFFFFF
204         
205                 ldc.i4.1
206                 stloc v1
207                 
208                 ldloc   v7FFFFFFF
209                 ldloc   v1
210                 shl
211                 ldc.i4  0xFFFFFFFE
212                 ceq
213                 ret
214         }
215         
216         // this only happens with the managed pointer, not an unmanaged one.
217         .method static public int32 test_0_foo () il managed {
218         
219                 .locals init (
220                         int32&  buf
221                 )
222                 
223                 ldc.i4.5
224                 localloc
225                 
226                 stloc buf
227                 ldloc buf
228                 
229                 ldind.i4
230                 
231                 ret
232         }
233
234         .method static public int32 test_0_localloc () cil managed {
235                 .locals init (native int, native int, native int, native int, int32)
236
237                 ldc.i4 6
238                 localloc
239                 conv.i
240                 stloc.0
241
242                 ldc.i4 6
243                 localloc
244                 conv.i
245                 stloc.1
246
247                 ldc.i4 6
248                 localloc
249                 conv.i
250                 stloc.2
251
252                 // Variable length
253                 ldc.i4 128
254                 stloc.s 4
255                 ldloc.s 4
256                 localloc
257                 conv.i
258                 stloc.3
259
260                 // Check zero initialized
261                 ldloc.0
262                 ldind.i4
263                 ldc.i4.0
264                 beq OK1
265                 ldc.i4.1
266                 br FAIL
267
268 OK1:
269                 ldloc.3
270                 ldind.i4
271                 ldc.i4.0
272                 beq OK2
273                 ldc.i4.2
274                 br FAIL
275
276 OK2:
277                 ldloc.3
278                 ldc.i4.s 124
279                 add
280                 ldind.i4
281                 ldc.i4.0
282                 beq OK3
283                 ldc.i4.3
284                 br FAIL
285
286 OK3:
287                 ldloc.1
288                 ldc.i4 999999
289                 stind.i4
290                 ldloc.1
291                 ldind.i4
292                 ldc.i4 999999
293                 beq OK4
294                 ldc.i4.4
295                 br FAIL
296
297 OK4:
298                 ldloc.0
299                 ldc.i4 999999
300                 stind.i4
301                 ldloc.0
302                 ldind.i4
303                 ldc.i4 999999
304                 beq OK5
305                 ldc.i4.5
306                 br FAIL
307
308 OK5:
309                 // Try allocations bigger than one page
310                 ldc.i4 8196
311                 localloc
312                 conv.i
313                 stloc.3
314                 ldloc.3
315                 ldc.i4 8192
316                 add
317                 ldc.i4 99
318                 stind.i4
319                 ldloc.3
320                 ldc.i4 8192
321                 add
322                 ldind.i4
323                 ldc.i4 99
324                 beq PASS
325                 ldc.i4.6
326                 br FAIL
327
328 FAIL:
329                 ret
330
331 PASS:   ldc.i4.0
332                 ret
333         }
334
335     .method private static void do_localloc () cil managed {
336         .maxstack 3
337         .locals init (
338                 unsigned int8*  V_0)
339         IL_0000:  ldc.i4.1
340         IL_0001:  ldc.i4 131072
341         IL_0006:  mul
342         IL_0007:  localloc
343         IL_0009:  stloc.0
344         IL_000a:  ret
345     }
346
347         // Check that localloc can't be inlined
348         .method static public int32 test_0_localloc_inline () cil managed {
349                 .maxstack 16
350                 .locals init (
351                         int32 i
352                 )
353
354                 ldc.i4.0
355         stloc.0
356         br COND
357
358 START:  call void class Tests::do_localloc()
359         ldloc.0
360         ldc.i4.1
361         add
362         stloc.0
363 COND:   ldloc.0
364         ldc.i4 1000
365         blt START
366
367                 ldc.i4.0
368                 ret
369         }       
370         
371         .method static public int32 test_3_copy_used_bug () il managed {
372
373                 .locals init (
374                         int32 size,
375                         int32 res
376                 )
377
378                 ldc.i4 0
379                 stloc res
380
381                 ldc.i4 1
382                 stloc size
383
384                 ldloc size
385                 ldloc size
386                 ldloc size
387                 add
388                 stloc size
389                 ldloc size
390                 add
391                 stloc res
392
393                 ldloc res
394                 ret
395         }
396
397         // demonstrate that the copy_used_var is not a fix for the above bug
398         .method static public int32 test_3_copy_used_indir_bug () il managed {
399
400                 .locals init (
401                         int32 size,
402                         int32 res
403                 )
404
405                 ldc.i4 0
406                 stloc res
407
408                 ldc.i4 1
409                 stloc size
410
411                 ldloc size
412                 ldloca size
413                 ldloc size
414                 ldloc size
415                 add
416                 stind.i4
417                 ldloc size
418                 add
419                 stloc res
420
421                 ldloc res
422                 ret
423         }
424
425         .method static public void do_nothing (int32 a) il managed {
426                 ret
427         }
428         
429         // demonstrate the block_split failure: needs -O=inline
430         // mini -O=inline --compile Tests:test_0_split_block_bug iltests.exe
431         .method static public int32 test_0_split_block_bug () il managed {
432
433                 .locals init (
434                         int32 i1
435                 )
436
437                 ldc.i4 1
438                 stloc i1
439  test_label:
440                 ldloc i1
441                 call void class Tests::do_nothing (int32)
442                 ldc.i4 0
443                 brtrue test_label
444                 
445                 ldc.i4 0
446                 ret
447         }
448
449         .method public void inline_do_nothing () il managed {
450                 ret
451         }
452         .method static public int32 test_1_checkthis_inlining () il managed {
453                 ldnull
454                 call instance void class Tests::inline_do_nothing ()
455                 ldc.i4 1
456                 ret
457         }
458
459         .class nested private auto ansi sealed beforefieldinit TailCallStruct 
460                 extends [mscorlib]System.ValueType {
461                 .field public int32 a
462                 .field public int32 b
463         }
464
465         .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
466                 ldarga 0
467                 ldarga 0
468                 ldfld int32 Tests/TailCallStruct::a
469                 ldc.i4.1
470                 add
471                 stfld int32 Tests/TailCallStruct::a
472                 ldarga 0
473                 ldarga 0
474                 ldfld int32 Tests/TailCallStruct::a
475                 ldc.i4.2
476                 add
477                 stfld int32 Tests/TailCallStruct::a
478                 ldarg.0
479                 ret
480         }
481
482         .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
483                 ldarg.0
484                 tail.
485                 call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
486                 ret
487         }
488
489         .method static public int32 test_0_tail_calls () il managed {
490                 .maxstack 16
491                 .locals init (
492                         valuetype Tests/TailCallStruct arg
493                 )
494                 ldloca 0
495                 ldc.i4.2
496                 stfld int32 Tests/TailCallStruct::a
497                 ldloca 0
498                 ldc.i4.4
499                 stfld int32 Tests/TailCallStruct::b
500                 ldloc.0
501                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
502                 stloc.0
503                 ldloca 0
504                 ldfld int32 Tests/TailCallStruct::a
505                 ldloca 0
506                 ldfld int32 Tests/TailCallStruct::b
507                 add
508                 ldc.i4 9
509                 sub
510                 ret
511         }
512
513         .method static public int32 tail3 (int32 i, int32 j) il managed {
514                 ldarg.0
515                 ldarg.1
516                 add
517                 ret
518         }
519
520         .method static public int32 tail4 (int32 i, int32 j) il managed {
521                 .maxstack 16
522                 .locals init (
523                         int32 k)
524
525                 // Test arg0 allocated to a register
526                 ldarg.0
527                 ldarg.0
528                 ldarg.0
529                 ldarg.0
530                 add
531                 add
532                 add
533                 starg 0
534
535                 // Test switched up argument variables as the actual arguments
536                 ldarg.1
537                 ldarg.0
538                 tail.
539                 call int32 Tests::tail3 (int32, int32)
540                 ret
541         }
542
543         .method static public int32 test_24_tail_calls2 () il managed {
544                 .maxstack 16
545                 .locals init (
546                         int32 i,
547                         int32 j)
548
549                 ldc.i4.4
550                 stloc.0
551                 ldc.i4.8
552                 stloc.1
553
554                 ldloc.0 
555                 ldloc.1
556                 call int32 Tests::tail4 (int32, int32)
557                 ret
558         }
559
560         .method public static int32 test_5_jmp () cil managed {
561                 ldc.i4.1
562                 ldc.i4.2
563                 call int32 Tests::jmp2 (int32, int32)
564                 ret
565         }
566
567         .method public static int32 jmp2 (int32, int32) cil managed {
568                 ldarg.0
569                 ldc.i4.1
570                 add
571                 starg.s 0
572                 ldarg.1
573                 ldc.i4.1
574                 add
575                 starg.s 1
576                 jmp int32 Tests::jmp3 (int32, int32)
577                 ldc.i4.0
578                 ret
579         }               
580
581         .method public static int32 jmp3 (int32 i, int32 j) cil managed {
582                 ldarg.0
583                 ldarg.1
584                 add
585                 ret
586         }
587
588         .method static public int32 test_11_switch_with_nonempty_stack () il managed {
589                 .maxstack 16
590
591                 ldc.i4.5
592                 ldc.i4.6
593                 ldc.i4.1
594                 switch (L0, L1)
595         L0: 
596                 add
597                 ret
598         L1:
599                 add
600                 ret
601         }
602  
603     .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
604                 .maxstack 16
605
606         .try {
607           leave IL_0
608         }
609         finally  {
610           ldc.i4.0
611           endfinally
612         }
613         IL_0:  ldc.i4.5
614                 ret
615     }
616
617         .method public static int32 test_0_conv_ovf_i8_neg () il managed {
618                 .maxstack 16
619
620                 ldc.i4.m1
621                 conv.ovf.i8
622                 conv.i4
623                 ldc.i4.m1
624                 beq L_OK
625                 ldc.i4.1
626                 ret
627         L_OK:
628                 ldc.i4.0
629                 ret
630         }               
631
632         .method public static int32 test_1234_conv_u4 () cil managed {
633                 .maxstack 16
634
635                 ldc.i4 1234
636                 conv.u4
637                 conv.i4
638                 ret
639         }
640
641         .method public static int32 test_0_conv_ovf_i_un () cil managed {
642                 .maxstack 16
643
644                 ldc.i4 1234
645                 conv.ovf.i.un
646                 conv.i4
647                 ldc.i4 1234
648                 beq L1
649                 ldc.i4.1
650                 ret
651         L1:
652                 ldc.i4 0x7fffffff
653                 conv.ovf.i.un
654                 conv.i4
655                 ldc.i4 0x7fffffff
656                 beq L2
657                 ldc.i4.2
658                 ret
659         L2:
660                 sizeof [mscorlib]System.IntPtr
661                 ldc.i4 8
662                 beq L5
663                 .try {
664                         ldc.i4 0x80000000
665                         conv.ovf.i.un
666                         leave L4
667                 } catch [mscorlib]System.OverflowException {
668                         pop
669                         leave L5
670                 }
671         L4: 
672                 ldc.i4.3
673                 ret
674         L5:
675                 ldc.i4.0
676                 ret
677         }
678
679         .method public static int32 test_0_conv_ovf_u_un () cil managed {
680                 .maxstack 16
681
682                 ldc.i4 1234
683                 conv.ovf.u.un
684                 conv.i4
685                 ldc.i4 1234
686                 beq L1
687                 ldc.i4.1
688                 ret
689         L1:
690                 ldc.i4.0
691                 ret
692         }
693
694         .method public static int32 test_0_conv_ovf_i () cil managed {
695                 .maxstack 16
696
697                 ldc.i4 1234
698                 conv.ovf.i
699                 conv.i4
700                 ldc.i4 1234
701                 beq L1
702                 ldc.i4.1
703                 ret
704         L1:
705                 ldc.i4.0
706                 ret
707         }
708
709         .method public static int32 test_0_conv_ovf_u () cil managed {
710                 .maxstack 16
711
712                 ldc.i4 1234
713                 conv.ovf.u
714                 conv.i4
715                 ldc.i4 1234
716                 beq L1
717                 ldc.i4.1
718                 ret
719         L1:
720                 ldc.i4.0
721                 ret
722         }
723
724         .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
725                 .maxstack 16
726
727                 ldc.i4 1234
728                 conv.ovf.i8.un
729                 conv.i4
730                 ret
731         }
732
733         .method public static int32 test_0_lconv_ovf_i () cil managed {
734                 .maxstack 16
735
736                 ldc.i4 1234
737                 conv.i8
738                 conv.ovf.i
739                 conv.i4
740                 ldc.i4 1234
741                 beq L1
742                 ldc.i4.1
743                 ret
744         L1:
745                 ldc.i4.0
746                 ret
747         }
748
749         .method public static int32 test_0_lconv_ovf_u () cil managed {
750                 .maxstack 16
751
752                 ldc.i4 1234
753                 conv.i8
754                 conv.ovf.u
755                 conv.i4
756                 ldc.i4 1234
757                 beq L1
758                 ldc.i4.1
759                 ret
760         L1:
761                 ldc.i4.0
762                 ret
763         }
764
765         .method public static int32 test_0_lconv_ovf_i_un () cil managed {
766                 .maxstack 16
767
768                 ldc.i4 1234
769                 conv.i8
770                 conv.ovf.i.un
771                 conv.i4
772                 ldc.i4 1234
773                 beq L1
774                 ldc.i4.1
775                 ret
776         L1:
777                 ldc.i4.0
778                 ret
779         }
780
781         .method public static int32 test_0_lconv_ovf_u_un () cil managed {
782                 .maxstack 16
783
784                 ldc.i4 1234
785                 conv.i8
786                 conv.ovf.u.un
787                 conv.i4
788                 ldc.i4 1234
789                 beq L1
790                 ldc.i4.1
791                 ret
792         L1:
793                 ldc.i4.0
794                 ret
795         }
796
797         .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
798                 .maxstack 16
799
800                 ldc.i4 1234
801                 conv.i8
802                 conv.ovf.u8.un
803                 conv.i4
804                 ldc.i4 1234
805                 beq L1
806                 ldc.i4.1
807                 ret
808         L1:
809                 ldc.i4.0
810                 ret
811         }
812
813         .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
814                 .maxstack 16
815                 .locals init (int32 res)
816
817                 ldc.i4 0x7fffffff
818                 conv.u8
819                 conv.ovf.i4.un
820                 pop
821
822                 ldc.i4.2
823                 stloc res
824
825         .try {
826                         ldc.i8 0x80000000
827                         conv.ovf.i4.un
828                         pop
829                         ldc.i4.0
830                         stloc res
831                         leave RET
832                 } catch [mscorlib]System.OverflowException {
833                         pop
834                         leave IL_0
835                 }
836
837         IL_0:
838
839         .try {
840                         ldc.i8 0xffffffff80000000
841                         conv.ovf.i4.un
842                         pop
843                         ldc.i4.1
844                         stloc res
845                         leave RET
846                 } catch [mscorlib]System.OverflowException {
847                         pop
848                         leave RET
849                 }
850
851         RET:
852                 ldloc res
853                 ret
854         }
855
856     .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
857                 .maxstack 16
858                 .locals init (int32 res)
859
860                 ldc.i4 0x7fffffff
861                 conv.u8
862                 conv.ovf.i.un
863                 conv.i4
864                 pop
865
866                 ldc.i4.1
867                 ret
868         }
869
870         .method public static int32 test_32_lconv_to_u8 () cil managed
871         {
872                 .maxstack 16
873
874                 ldc.i4 32
875                 conv.i8
876                 conv.u8
877                 conv.i4
878                 ret
879         }                               
880
881         .method public static int32 test_32_lconv_to_i8 () cil managed
882         {
883                 .maxstack 16
884
885                 ldc.i4 32
886                 conv.i8
887                 conv.i8
888                 conv.i4
889                 ret
890         }                               
891
892         .method public static int32 test_15_lconv_to_u () cil managed
893         {
894         ldc.i8 0x10000000f
895                 conv.u
896                 conv.i4
897                 ret
898         }
899
900 #if !defined(__ppc__) && !defined(__powerpc__)
901         // PPC handles overflow by clipping, but this test assumes
902         // no overflow handling.  According to ECMA the result of
903         // float->int conversion is undefined if overflow occurs, so
904         // both behaviours are valid.
905         .method public static int32 test_0_fconv_to_i () cil managed {
906                 .maxstack 16
907
908                 ldc.r8 2147483648.0
909                 conv.i
910                 ldc.i8 2147483648
911                 conv.i
912                 beq L1
913                 ldc.i4.1
914                 ret
915         L1:
916                 ldc.i4.0
917                 ret
918         }
919 #endif
920
921         .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
922         {
923                 .maxstack 16
924         
925                 ldc.i4.1
926                 brfalse OBJECT
927         
928                 ldtoken [mscorlib]System.String
929                 br AFTER
930         OBJECT:
931                 ldtoken [mscorlib]System.Object
932         AFTER:
933                 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
934                 callvirt instance string class [mscorlib]System.Type::get_FullName ()
935                 ldstr "System.String"
936                 callvirt instance bool class [mscorlib]System.Object::Equals(object)
937                 ldc.i4.0
938                 ceq
939                 ret 
940         }
941                 
942         .method public static int32 test_0_bug59580  ()
943         {
944                 ldc.r4          float32(0x7FC00000)
945                 ldc.r4          float32(0x7FC00000)
946                 bge.un          pass
947                 br              fail
948         pass:
949                 ldc.i4.0
950                 ret
951         fail:
952                 ldc.i4.1
953                 ret
954         }
955         
956         .method public static int32 test_1_bug60056  () {
957                 .locals init (int32 m5)
958                         
959                 ldc.i4.m1
960                 stloc.0
961                 
962                 ldc.i4.1
963                 conv.u8
964                 
965                 ldloc.0
966                 conv.i8
967                 mul
968                 
969                 ldc.i4.m1
970                 conv.i8
971                 ceq
972                 ret
973         }
974         
975         .method public static int32 test_1_conv_u8_cfold  () {
976                 ldc.i4.m1
977                 conv.u8
978                 
979                 ldc.i8 0x00000000ffffffff
980                 
981                 ceq
982                 ret
983         }
984         
985         .method public static int32 test_1_array_type_mismatch_ldelema  () {
986                 .locals init (int32 r)
987                 
988                         ldc.i4.1
989                         newarr string
990                         ldc.i4.0 
991                         ldelema string
992                         pop
993                 
994                 .try {
995                         ldc.i4.1
996                         newarr string
997                         ldc.i4.0 
998                         ldelema object
999                         pop
1000                         
1001                         leave end
1002                 } catch [mscorlib]System.ArrayTypeMismatchException {
1003                         pop
1004                         ldc.i4.1
1005                         stloc.0
1006                         leave end
1007                 }
1008         end:
1009                 ldloc.0
1010                 ret
1011         }
1012
1013         .method public static int32 test_1_conv_ovf_i8_with_i4 () {
1014                         ldc.i4.m1 
1015                         conv.ovf.i8
1016                         conv.ovf.i4
1017                         neg
1018                         ret
1019         }
1020
1021         // bug #72148
1022     .method public static int32 test_0_initlocals_float_ptr () {
1023         .maxstack 3
1024         .locals init (
1025                 float32[]       V_0,
1026                 float32& pinned V_1,
1027                 unsigned int32  V_2)
1028                         ldc.i4.s 0x0f
1029                         newarr [mscorlib]System.Single
1030                         stloc.0 
1031                         ldloc.0 
1032                         ldc.i4.0 
1033                         ldc.r4 1.13
1034                         stelem.r4 
1035                         ldloc.0 
1036                         ldc.i4.0 
1037                         ldelema [mscorlib]System.Single
1038                         stloc.1 
1039                         ldloc.1 
1040                         conv.i 
1041                         ldind.u4 
1042                         stloc.2 
1043                         ldc.i4.0
1044                         ret
1045         }
1046
1047         .method public static int32 test_7_conv_ovf_u8_un () {
1048         .maxstack  2
1049         .locals    init (unsigned int64)
1050
1051         ldc.i4.7
1052         conv.ovf.u8.un
1053         stloc.0
1054                 ldloc.0
1055                 conv.i4
1056         ret
1057         }
1058
1059         .method public static int32 test_1_bug_74591 () {
1060                 .maxstack 16
1061                 .locals init (int32)
1062
1063                 ldc.i4.m1
1064                 stloc.0
1065                 ldloc.0
1066                 conv.ovf.i8
1067                 ldc.i4.m1
1068                 conv.ovf.i8
1069                 mul.ovf
1070                 conv.i4
1071                 ret
1072         }
1073
1074         .class nested public auto ansi Integer
1075                 extends [mscorlib]System.Object {
1076
1077                 .field public bool n
1078
1079             .method public hidebysig  specialname  rtspecialname 
1080            instance default void .ctor (unsigned int64 i, bool n)  cil managed 
1081             {
1082                         .maxstack 8
1083                         ldarg.0
1084                         call instance void class [mscorlib]System.Object::.ctor()
1085                         ldarg.0
1086                         ldarg.2
1087                         stfld bool Tests/Integer::n
1088                         ret
1089                 }
1090         }
1091
1092         .method public static int32 test_1_bug_74726 () {
1093                 .maxstack 16
1094
1095                 ldc.i4.2
1096                 conv.ovf.u8
1097                 ldc.i4.1
1098                 conv.ovf.u8
1099                 mul.ovf.un
1100                 ldc.i4.1
1101                 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
1102                 ldfld bool Tests/Integer::n
1103                 ldc.i4.1
1104                 ceq
1105                 ret
1106         }
1107
1108         .class nested private auto ansi sealed xxx
1109         extends [mscorlib]System.ValueType
1110    {
1111      .field  public   object a
1112
1113      .method public hidebysig  specialname  rtspecialname 
1114             instance default void .ctor ()  cil managed 
1115      {
1116                  .maxstack 8
1117                  ret 
1118      }
1119    } // end of class xxx
1120
1121         .method public static int32 test_0_newobj_vtype () {
1122                 .maxstack 6
1123                 .locals init (
1124                         valuetype Tests/xxx V_0
1125                 )
1126
1127                 newobj instance void valuetype Tests/xxx::.ctor ()
1128                 stloc.0
1129                 ldloca.s 0
1130                 ldfld object Tests/xxx::a
1131                 brfalse OK
1132                 ldc.i4.s 1
1133                 ret
1134         OK:
1135                 ldc.i4.s 0
1136                 ret
1137         }
1138
1139         .method public static int32 test_0_newobj_vtype_primitive () {
1140                 .maxstack 6
1141                 .locals init (
1142                         native int V_0
1143                 )
1144
1145                 ldc.i4.s 10
1146                 newobj instance void native int::'.ctor'(int32)
1147                 stloc.0
1148                 ldloc.0
1149                 ldc.i4.s 10
1150                 beq OK
1151                 ldc.i4.s 1
1152                 ret
1153         OK:
1154                 ldc.i4.s 0
1155                 ret
1156         }
1157
1158         .method public static int32 test_1_filters () {
1159                 .maxstack 16
1160                 .locals init (
1161                         int32 res
1162                 )
1163
1164                 .try { // 0
1165                         .try {
1166                                 ldstr "OnErrorSub test Exception"
1167                                 newobj instance void class [mscorlib]System.Exception::.ctor(string)
1168                                 throw 
1169                                 leave.s IL_0033
1170                         }
1171                         filter {
1172                                 pop
1173                                 ldc.i4.0
1174                                 endfilter
1175                         } {
1176                                 pop
1177                                 // Should not be called
1178                                 ldc.i4.2
1179                                 stloc res
1180                                 leave.s IL_0033
1181                         }
1182                 }
1183                 filter {
1184                         pop
1185                         ldc.i4.1
1186                         endfilter 
1187                 } {
1188                   pop
1189                   ldc.i4.1
1190                   stloc res       
1191                   leave.s IL_0033
1192
1193                 }
1194                 IL_0033:
1195                 ldloc res
1196                 ret
1197         }
1198
1199         .class nested private auto ansi sealed beforefieldinit TheStruct
1200                 extends [mscorlib]System.ValueType {
1201                 .field public int32 a
1202                 .field public int32 b
1203         }
1204
1205         .method public static int32 test_5_cpobj () {
1206                 .maxstack 8
1207                 .locals init (  
1208                                 valuetype Tests/TheStruct v_0, 
1209                                 valuetype Tests/TheStruct v_1
1210                                          )
1211
1212                 ldloca v_0
1213                 ldc.i4.2
1214                 stfld int32 Tests/TheStruct::a
1215
1216                 ldloca v_0
1217                 ldc.i4.3
1218                 stfld int32 Tests/TheStruct::b
1219
1220                 ldloca v_1
1221                 ldloca v_0
1222                 cpobj Tests/TheStruct
1223
1224                 ldloca v_1
1225                 ldfld int32 Tests/TheStruct::a
1226                 ldloca v_1
1227                 ldfld int32 Tests/TheStruct::b
1228                 add
1229
1230                 ret
1231         }
1232
1233         .method public static int32 test_5_ldobj_stloc_optimization () {
1234                 .maxstack 8
1235                 .locals init (  
1236                                 valuetype Tests/TheStruct v_0, 
1237                                 valuetype Tests/TheStruct v_1
1238                                          )
1239
1240                 ldloca v_0
1241                 ldc.i4.2
1242                 stfld int32 Tests/TheStruct::a
1243
1244                 ldloca v_0
1245                 ldc.i4.3
1246                 stfld int32 Tests/TheStruct::b
1247
1248                 ldloca v_0
1249                 ldobj valuetype Tests/TheStruct
1250                 stloc.s v_1
1251
1252                 ldloca v_1
1253                 ldfld int32 Tests/TheStruct::a
1254                 ldloca v_1
1255                 ldfld int32 Tests/TheStruct::b
1256                 add
1257
1258                 ret
1259         }
1260
1261         .method public static int32 test_1_cpobj_reference () {
1262                 .maxstack 8
1263                 .locals init (  
1264                                 object v_0, 
1265                                 object v_1
1266                                          )
1267
1268                 newobj instance void object::.ctor()
1269                 stloc v_0
1270
1271                 ldloca v_1
1272                 ldloca v_0
1273                 cpobj object
1274
1275                 ldloc v_0
1276                 ldloc v_1
1277                 ceq
1278                 ret
1279         }
1280
1281         .method public static int32 test_1_initobj_reference () {
1282                 .maxstack 8
1283                 .locals init (  
1284                                 object v_0
1285                                          )
1286
1287                 newobj instance void object::.ctor()
1288                 stloc v_0
1289
1290                 ldloca v_0
1291                 initobj object
1292
1293                 ldloc v_0
1294                 ldnull
1295                 ceq
1296                 ret
1297         }
1298
1299         .method public static int32 test_1_ldobj_reference () {
1300                 .maxstack 8
1301                 .locals init (  
1302                                 object v_0
1303                                          )
1304
1305                 newobj instance void object::.ctor()
1306                 stloc v_0
1307
1308                 ldloc v_0
1309                 ldloca v_0
1310                 ldobj object
1311                 ceq
1312                 ret
1313         }
1314
1315         .method public static int32 test_5_vtype_on_bb_boundary () {
1316                 .maxstack 8
1317                 .locals init (  
1318                                 valuetype Tests/TheStruct v_0, 
1319                                 valuetype Tests/TheStruct v_1
1320                                          )
1321
1322                 ldloca v_0
1323                 ldc.i4.2
1324                 stfld int32 Tests/TheStruct::a
1325
1326                 ldloca v_0
1327                 ldc.i4.3
1328                 stfld int32 Tests/TheStruct::b
1329
1330                 ldloc v_0
1331                 br L_0
1332         L_0: stloc v_1
1333
1334                 ldloca v_1
1335                 ldfld int32 Tests/TheStruct::a
1336                 ldloca v_1
1337                 ldfld int32 Tests/TheStruct::b
1338                 add
1339                 ret
1340         }
1341
1342         .method public static int32 test_5_different_in_stacks () cil managed {
1343                 .maxstack 16
1344
1345                         ldc.i4.1
1346                         ldc.i4.1
1347                         beq L_0
1348
1349                         ldc.i4.3
1350                         ldc.i4.3
1351                         br L_1
1352                         ldc.i4.3
1353                         ldc.i4.3
1354                         br L_2
1355          L_0:   ldc.i4.2
1356                         ldc.i4.3
1357                         ldc.i4.1
1358                         ldc.i4.1
1359                         beq L_2
1360          L_1:   add
1361                         ret
1362          L_2:   add
1363                         ret
1364         }
1365
1366         .method public static int32 test_3_larray_get_set () {
1367                 .locals init (
1368                         int32[2]        V_0)
1369                           
1370                         ldc.i4.2 
1371                         newobj instance void int32[0...]::.ctor(int32)
1372                         stloc.0 
1373                         ldloc.0 
1374                         ldc.i4.0 
1375                         ldc.i4 1
1376                         call instance void int32[0...]::Set(int32, int32)
1377                     ldloc.0 
1378                     ldc.i4.1 
1379                         ldc.i4 2
1380                         call instance void int32[0...]::Set(int32, int32)
1381
1382                         ldloc.0
1383                         ldc.i4.0
1384                         call instance int32 int32[0...]::Get(int32)
1385                         ldloc.0
1386                         ldc.i4.1
1387                         call instance int32 int32[0...]::Get(int32)
1388                         add
1389                         ret
1390         }
1391
1392         .method public static int32 test_0_pop_side_effects () {
1393                 .try {
1394                         ldc.r8 1
1395                         ldc.r8 0
1396                         div
1397                         ckfinite
1398                         pop
1399                         leave FAIL
1400                 }
1401                 catch [mscorlib]System.ArithmeticException {
1402                         pop
1403                         leave L_0
1404                 }
1405                 L_0:
1406                 ldc.i4.0
1407                 ret
1408                 FAIL:
1409                 ldc.i4.1
1410                 ret
1411         }
1412
1413         .method public static void regalloc_regress_78314_helper (object o) cil managed
1414         {
1415                 ret
1416         }
1417
1418         .method public static int32 test_1_regalloc_regress_78314 () cil managed
1419         {
1420     // Code size       68 (0x44)
1421     .maxstack  6
1422     .locals init (int32 V_0, bool V_1)
1423     IL_0000:  ldc.i4.0
1424     IL_0001:  stloc.0
1425     IL_0002:  br.s       IL_003b
1426
1427     IL_0004:
1428     IL_001e:  ldc.i4.s   10
1429     IL_0020:  ldloc.0
1430     IL_0021:  shl
1431     IL_0022:  ldc.i4.s   10
1432     IL_0024:  ldloc.0
1433     IL_0025:  shl
1434     IL_0026:  ceq
1435     IL_0028:  box        [mscorlib]System.Boolean
1436     IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
1437     IL_0037:  ldloc.0
1438     IL_0038:  ldc.i4.1
1439     IL_0039:  add
1440     IL_003a:  stloc.0
1441     IL_003b:  ldloc.0
1442     IL_003c:  ldc.i4.8
1443     IL_003f:  blt.s      IL_0004
1444
1445         ldloc.0
1446         ldc.i4.8
1447         ceq
1448         conv.i4
1449         ret     
1450   }
1451
1452         .method public static void try_block_end_remove_if_useless () cil managed {
1453             .maxstack  8
1454
1455             T_START:
1456                 ldstr   "Start"
1457                         pop
1458                 leave.s COMPLETE
1459             T1_END:
1460
1461             COMPLETE:
1462                 ret
1463
1464             F1_START:
1465                 ldstr   "Finally1"
1466                         pop
1467                 endfinally
1468             F1_END:
1469
1470             .try T_START to T1_END finally handler F1_START to F1_END
1471         }
1472
1473         .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1474                 call void class Tests::try_block_end_remove_if_useless ()
1475                 ldc.i4.0
1476                 ret
1477         }
1478
1479    .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
1480     {
1481         ldc.i4.0
1482         switch (target)
1483         target: ldstr "bar"
1484                 pop
1485                 ldc.i4.0
1486         ret
1487     }
1488
1489         // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1490         // generate the non .un version of the opcodes
1491     .method private static  hidebysig 
1492            default int32 test_4_float_branch_nan ()  cil managed 
1493     {
1494         // Method begins at RVA 0x27a4
1495         // Code size 74 (0x4a)
1496         .maxstack 2
1497         .locals init (
1498                 float64 V_0,
1499                 float64 V_1,
1500                 int32   V_2)
1501         IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
1502         IL_0009:  stloc.0 
1503         IL_000a:  ldc.r8 1.
1504         IL_0013:  stloc.1 
1505         IL_0014:  ldc.i4.0 
1506         IL_0015:  stloc.2 
1507         IL_0016:  ldloc.0 
1508         IL_0017:  ldloc.1 
1509         IL_0018:  bge.s IL_001a
1510
1511                                 br L1
1512         IL_001a:  ldloc.2 
1513         IL_001b:  ret 
1514         L1:
1515         IL_001c:  ldloc.2 
1516         IL_001d:  ldc.i4.1 
1517         IL_001e:  add 
1518         IL_001f:  stloc.2 
1519         IL_0020:  ldloc.0 
1520         IL_0021:  ldloc.1 
1521         IL_0022:  ble.s IL_002e
1522                                 br L2
1523         IL_002e:  ldloc.2 
1524         IL_002f:  ret 
1525         L2:
1526         IL_0030:  ldloc.2 
1527         IL_0031:  ldc.i4.1 
1528         IL_0032:  add 
1529         IL_0033:  stloc.2 
1530         IL_0034:  ldloc.0 
1531         IL_0035:  ldloc.1 
1532         IL_0036:  blt.s IL_0038
1533                                 br L3           
1534         IL_0038:  ldloc.2 
1535         IL_0039:  ret 
1536         L3:
1537         IL_003a:  ldloc.2 
1538         IL_003b:  ldc.i4.1 
1539         IL_003c:  add 
1540         IL_003d:  stloc.2 
1541         IL_003e:  ldloc.0 
1542         IL_003f:  ldloc.1 
1543         IL_0040:  bgt.s IL_0042
1544                                 br L4
1545         IL_0042:  ldloc.2 
1546         IL_0043:  ret 
1547         L4:
1548         IL_0044:  ldloc.2 
1549         IL_0045:  ldc.i4.1 
1550         IL_0046:  add 
1551         IL_0047:  stloc.2 
1552         IL_0048:  ldloc.2 
1553         IL_0049:  ret 
1554     } // end of method Tests::test_5_float_branch_nan
1555
1556     .method private static  hidebysig
1557            default void regress_80622_inner (object x)  cil managed
1558     {
1559                 .locals (unsigned int8 i)
1560         // Method begins at RVA 0x2050
1561         // Code size 14 (0xe)
1562         .maxstack 8
1563         IL_1000:  ldarg.0
1564         IL_1001:  unbox unsigned int8
1565         IL_1006:  ldobj unsigned int8
1566         IL_000b:  conv.ovf.i4.un
1567         IL_000c:  pop
1568         IL_000d:  ret
1569     }
1570
1571     // method line 2
1572     .method private static  hidebysig
1573            default int32 test_0_regress_80622 ()  cil managed
1574     {
1575         .maxstack 8
1576         IL_0000:  ldc.i4 255
1577         IL_0005:  box unsigned int8
1578         IL_000a:  call void class Tests::regress_80622_inner (object)
1579                 ldc.i4.0
1580         IL_000f:  ret
1581     }
1582
1583         .method private static default int32 test_0_regresss_80190 () cil managed
1584         {
1585             .maxstack  2
1586             .locals init (int32 V_0,
1587                      int32* V_1)
1588             IL_0000:  nop
1589             IL_0001:  nop
1590             IL_0002:  ldloca.s   V_0
1591             IL_0004:  conv.u
1592             IL_0005:  stloc.1
1593             IL_0006:  ldloc.1
1594             IL_0007:  ldc.i4.3
1595             IL_0008:  stind.i4
1596             IL_0009:  nop
1597                                   ldc.i4.0
1598                                   ret
1599         }
1600
1601         .class interface nested public auto ansi abstract IFaceWithStaticMethod
1602         {
1603             .method public static  specialname 
1604                default void foo ()  cil managed noinlining 
1605             {
1606                 .maxstack 0
1607                 IL_0000:  ret 
1608         }
1609         }
1610         
1611         .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1612         {
1613             .method public hidebysig  specialname  rtspecialname 
1614            instance default void .ctor ()  cil managed 
1615             {
1616                         .maxstack 8
1617                         ret
1618                 }
1619
1620         }
1621
1622         // Test that static methods in interfaces are ignored during vtable construction
1623         .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1624         {
1625                 .maxstack 16
1626
1627                 newobj instance void class Tests/AClass::.ctor()
1628                 pop
1629                 ldc.i4.0
1630                 ret
1631         }
1632
1633         .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
1634                 ldarg.0
1635                 box !!0
1636                 brtrue HAS_VALUE
1637                 ldc.i4.0
1638                 ret
1639 HAS_VALUE:      ldc.i4.1
1640                 ret
1641         }
1642
1643         // bug 78019
1644         .method static public int32 test_0_nullable_box_brtrue () cil managed {
1645
1646                 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1647
1648                 ldloc.0
1649                 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1650                 ret
1651         }
1652
1653         //Bug 372410
1654         .method static public int32 test_0_ldelema_type_check () cil managed {
1655                 .maxstack 16
1656                 .locals init (object[] V_0,
1657                                           object[,] V_1)
1658
1659                 ldc.i4.1
1660                 newarr object
1661                 stloc.0
1662
1663                 .try {
1664                         ldloc.0
1665                         ldc.i4.0
1666                         ldelema object
1667                         leave L1
1668                 } catch [mscorlib]System.ArrayTypeMismatchException {
1669                         leave ERROR1
1670                 }
1671
1672         L1:
1673                 ldc.i4.1
1674                 newarr string
1675                 stloc.0
1676
1677                 .try {
1678                         ldloc.0
1679                         ldc.i4.0
1680                         ldelema object
1681                         leave ERROR2
1682                 } catch [mscorlib]System.ArrayTypeMismatchException {
1683                         leave L2
1684                 }
1685
1686         L2:
1687                         ldc.i4.1
1688                 newarr string
1689                 stloc.0
1690
1691                 .try {
1692                         ldloc.0
1693                         ldc.i4.0
1694                         readonly. ldelema object
1695                         leave L3
1696                 } catch [mscorlib]System.ArrayTypeMismatchException {
1697                         leave ERROR3
1698                 }
1699
1700         L3:
1701                 ldc.i4.0
1702                 ret
1703
1704
1705         ERROR1:
1706                 ldc.i4.1
1707                 ret
1708
1709         ERROR2:
1710                 ldc.i4.2
1711                 ret
1712
1713         ERROR3:
1714                 ldc.i4.3
1715                 ret
1716         }
1717
1718
1719         //Bug 372410
1720         .method static public int32 test_0_array_address_type_check () cil managed {
1721                 .maxstack 16
1722                 .locals init (object[] V_0,
1723                                           object[,] V_1)
1724
1725                 ldc.i4.1 
1726             ldc.i4.1 
1727             newobj instance void object[,]::.ctor(int32, int32)
1728                 stloc.1
1729
1730                 .try {
1731                         ldloc.1
1732                         ldc.i4.0
1733                         ldc.i4.0
1734                         call instance object&  object[,]::Address(int32, int32)
1735                         leave L4
1736                 } catch [mscorlib]System.ArrayTypeMismatchException {
1737                         leave ERROR4
1738                 }
1739
1740         L4:
1741                 ldc.i4.1 
1742             ldc.i4.1 
1743             newobj instance void string[,]::.ctor(int32, int32)
1744                 stloc.1
1745
1746                 .try {
1747                         ldloc.1
1748                         ldc.i4.0
1749                         ldc.i4.0
1750                         call instance object&  object[,]::Address(int32, int32)
1751                         leave ERROR5
1752                 } catch [mscorlib]System.ArrayTypeMismatchException {
1753                         leave L5
1754                 }
1755
1756         L5:
1757                 ldc.i4.1 
1758             ldc.i4.1 
1759             newobj instance void string[,]::.ctor(int32, int32)
1760                 stloc.1
1761
1762                 .try {
1763                         ldloc.1
1764                         ldc.i4.0
1765                         ldc.i4.0
1766                         readonly. call instance object&  object[,]::Address(int32, int32)
1767                         leave L6
1768                 } catch [mscorlib]System.ArrayTypeMismatchException {
1769                         leave ERROR6
1770                 }
1771
1772         L6:
1773                 ldc.i4.0
1774                 ret
1775         ERROR4:
1776                 ldc.i4.4
1777                 ret
1778
1779         ERROR5:
1780                 ldc.i4.5
1781                 ret
1782
1783         ERROR6:
1784                 ldc.i4.6
1785                 ret
1786         }
1787
1788         .field public  static unsigned int64 'ull'
1789
1790         .field public  static int32 'shift2'
1791
1792         .method public static int32 test_0_long_shift_regalloc () cil managed
1793         {
1794                 .locals (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
1795
1796                 .maxstack 4
1797
1798                 ldc.i8  81985529234382576
1799                 stsfld  unsigned int64 Tests::ull
1800             ldc.i4      60
1801                 stsfld  int32 Tests::shift2
1802
1803                 ldsfld  unsigned int64 Tests::ull
1804                 stloc   'cilsimp.27'
1805                 ldsfld  int32 Tests::shift2
1806                 stloc   'cilsimp.28'
1807                 ldloc   'cilsimp.27'
1808                 ldloc   'cilsimp.28'
1809                 shr.un
1810                 ldloc   'cilsimp.27'
1811                 ldc.i4  64
1812                 ldloc   'cilsimp.28'
1813                 sub
1814                 shl
1815                 or
1816                 ldc.i8  1311768467750121216
1817                 ceq
1818                 ldc.i4.1
1819                 xor
1820                 conv.u4
1821                 ret
1822         }
1823
1824         // Test calling ldfld directly on a vtype instead of a vtype address
1825         .method public static int32 test_5_call_ldfld_vtype () cil managed
1826         {
1827                 .maxstack 16
1828                 .locals init (
1829                         valuetype Tests/TailCallStruct arg
1830                 )
1831                 ldloca 0
1832                 ldc.i4.2
1833                 stfld int32 Tests/TailCallStruct::a
1834                 ldloca 0
1835                 ldc.i4.4
1836                 stfld int32 Tests/TailCallStruct::b
1837                 ldloc.0
1838                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
1839                 ldfld int32 Tests/TailCallStruct::a
1840                 ret
1841         }
1842
1843         .method public static int32 throw_ret () cil managed
1844         {
1845                 ldstr "FOO"
1846                 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
1847                 throw
1848                 ldc.i4.4
1849                 ret
1850         }
1851
1852         .method public static int32 throw2_ret () cil managed
1853         {
1854                 // Disable inlining
1855                 ldc.i4.5
1856                 localloc
1857                 pop
1858
1859                 call int32 Tests::throw_ret ()
1860                 ret
1861         }
1862
1863         // Test inlining a method which contains just a throw
1864         .method public static int32 test_0_inline_throw () cil managed
1865         {
1866                 .maxstack 16
1867                 .locals init (
1868                                 int32 v_0
1869                 )
1870
1871                 .try {
1872                         call int32 Tests::throw2_ret ()
1873                         stloc.0
1874                         leave L0
1875                 } catch [mscorlib]System.OverflowException {
1876                         pop
1877                         leave L1
1878                 }
1879
1880                 L0:
1881                         ldc.i4.1
1882                         ret
1883                 L1:
1884                         ldc.i4.0
1885                         ret                     
1886         }
1887
1888     .method public static int32 test_0_stelem_any_null_opt () cil managed
1889     {
1890                 .maxstack 16
1891                 .locals init (
1892                                 object[]        V_0,
1893                                 int32   V_1)
1894
1895                 ldc.i4.s 10
1896                 newarr [mscorlib]System.Object
1897                 stloc.0
1898
1899                 ldc.i4.0
1900                 stloc.1
1901                 br L0
1902
1903         L1:
1904                 ldloc.0
1905                 ldloc.1
1906                 ldnull
1907                 stelem.any [mscorlib]System.Object
1908                 ldloc.1
1909                 ldc.i4.1
1910                 add
1911                 stloc.1
1912         L0:
1913                 ldloc.1
1914                 ldc.i4.s 10
1915                 blt L1
1916
1917                 ldc.i4.0
1918                 ret
1919         }
1920
1921     // method line 2
1922     .method public static  hidebysig 
1923            default int32 manyargs_callee (int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h, int32 i, int32 j, int32 k, int32 l, int32 m, int32 n, int32 o, int32 p)  cil managed 
1924     {
1925         // Method begins at RVA 0x20f4
1926         // Code size 44 (0x2c)
1927         .maxstack 8
1928         IL_0000:  ldarg.0 
1929         IL_0001:  ldarg.1 
1930         IL_0002:  add 
1931         IL_0003:  ldarg.2 
1932         IL_0004:  add 
1933         IL_0005:  ldarg.3 
1934         IL_0006:  add 
1935         IL_0007:  ldarg.s 4
1936         IL_0009:  add 
1937         IL_000a:  ldarg.s 5
1938         IL_000c:  add 
1939         IL_000d:  ldarg.s 6
1940         IL_000f:  add 
1941         IL_0010:  ldarg.s 7
1942         IL_0012:  add 
1943         IL_0013:  ldarg.s 8
1944         IL_0015:  add 
1945         IL_0016:  ldarg.s 9
1946         IL_0018:  add 
1947         IL_0019:  ldarg.s 10
1948         IL_001b:  add 
1949         IL_001c:  ldarg.s 11
1950         IL_001e:  add 
1951         IL_001f:  ldarg.s 12
1952         IL_0021:  add 
1953         IL_0022:  ldarg.s 13
1954         IL_0024:  add 
1955         IL_0025:  ldarg.s 14
1956         IL_0027:  add 
1957         IL_0028:  ldarg.s 15
1958         IL_002a:  add 
1959         IL_002b:  ret 
1960     } // end of method main::callee
1961
1962     // method line 3
1963     .method public static  hidebysig 
1964            default int32 manyargs_tail_caller (int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h, int32 i, int32 j, int32 k, int32 l, int32 m, int32 n, int32 o, int32 p)  cil managed 
1965     {
1966         // Method begins at RVA 0x2124
1967         // Code size 34 (0x22)
1968         .maxstack 17
1969         IL_0000:  ldarg.0 
1970         IL_0001:  ldarg.1 
1971         IL_0002:  ldarg.2 
1972         IL_0003:  ldarg.3 
1973         IL_0004:  ldarg.s 4
1974         IL_0006:  ldarg.s 5
1975         IL_0008:  ldarg.s 6
1976         IL_000a:  ldarg.s 7
1977         IL_000c:  ldarg.s 8
1978         IL_000e:  ldarg.s 9
1979         IL_0010:  ldarg.s 10
1980         IL_0012:  ldarg.s 11
1981         IL_0014:  ldarg.s 12
1982         IL_0016:  ldarg.s 13
1983         IL_0018:  ldarg.s 14
1984         IL_001a:  ldarg.s 15
1985                   tail.
1986         IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
1987         IL_0021:  ret 
1988     } // end of method main::caller
1989
1990     // method line 4
1991     .method public static  hidebysig 
1992            default int32 test_0_many_args_tail_call ()  cil managed 
1993     {
1994         // Method begins at RVA 0x2154
1995         // Code size 43 (0x2b)
1996         .maxstack 17
1997         IL_0000:  ldc.i4.1 
1998         IL_0001:  ldc.i4.2 
1999         IL_0002:  ldc.i4.3 
2000         IL_0003:  ldc.i4.4 
2001         IL_0004:  ldc.i4.5 
2002         IL_0005:  ldc.i4.6 
2003         IL_0006:  ldc.i4.7 
2004         IL_0007:  ldc.i4.8 
2005         IL_0008:  ldc.i4.s 0x09
2006         IL_000a:  ldc.i4.s 0x0a
2007         IL_000c:  ldc.i4.s 0x0b
2008         IL_000e:  ldc.i4.s 0x0c
2009         IL_0010:  ldc.i4.s 0x0d
2010         IL_0012:  ldc.i4.s 0x0e
2011         IL_0014:  ldc.i4.s 0x0f
2012         IL_0016:  ldc.i4.s 0x10
2013         IL_0018:  call int32 class Tests::manyargs_tail_caller(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
2014         IL_001d:  ldc.i4 136
2015         IL_0022:  beq IL_0029
2016
2017         IL_0027:  ldc.i4.1 
2018         IL_0028:  ret 
2019         IL_0029:  ldc.i4.0 
2020         IL_002a:  ret 
2021     } // end of method main::Main
2022
2023         .class nested private auto ansi beforefieldinit R1
2024            extends [mscorlib]System.MarshalByRefObject
2025         {
2026                 .field  public  int32 test_field
2027
2028         .method public hidebysig  specialname  rtspecialname
2029                         instance default void '.ctor' ()  cil managed
2030         {
2031                         ret
2032                 }
2033         }
2034
2035         .method public static hidebysig
2036                         default int32 return_0 () cil managed
2037         {
2038                 ldc.i4.0
2039                 ret
2040         }
2041
2042         .method public static hidebysig
2043                         default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2044         {
2045                 .locals init (
2046                         class Tests/R1 v_0
2047                 )
2048
2049                 newobj instance void class Tests/R1::.ctor ()
2050                 stloc.0
2051                 ldloc.0
2052                 ldc.i4.0
2053                 volatile.
2054                 stfld int32 Tests/R1::test_field
2055                 call int32 class Tests::return_0 ()
2056                 ldc.i4.1
2057                 add
2058                 ret
2059         }
2060 }