2009-04-11 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         .class nested private auto ansi sealed beforefieldinit TailCallStructBig
490                 extends [mscorlib]System.ValueType {
491                 .field public int32 a
492                 .field public int32 b
493                 .field public int32 c
494         }
495
496         .method static valuetype Tests/TailCallStructBig tail1_big (valuetype Tests/TailCallStructBig arg) {
497                 ldarga 0
498                 ldarga 0
499                 ldfld int32 Tests/TailCallStructBig::a
500                 ldc.i4.1
501                 add
502                 stfld int32 Tests/TailCallStructBig::a
503                 ldarg.0
504                 ret
505         }
506
507         .method static valuetype Tests/TailCallStructBig tail2_big (valuetype Tests/TailCallStructBig arg) {
508                 ldarg.0
509                 tail.
510                 call valuetype Tests/TailCallStructBig Tests::tail1_big (valuetype Tests/TailCallStructBig)
511                 ret
512         }
513
514         .method static public int32 test_0_tail_calls () il managed {
515                 .maxstack 16
516                 .locals init (
517                         valuetype Tests/TailCallStruct arg,
518                         valuetype Tests/TailCallStructBig arg2
519                 )
520                 ldloca 0
521                 ldc.i4.2
522                 stfld int32 Tests/TailCallStruct::a
523                 ldloca 0
524                 ldc.i4.4
525                 stfld int32 Tests/TailCallStruct::b
526                 ldloc.0
527                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
528                 stloc.0
529
530                 ldloca 1
531                 ldc.i4.2
532                 stfld int32 Tests/TailCallStructBig::a
533                 ldloc.1
534                 call valuetype Tests/TailCallStructBig Tests::tail2_big (valuetype Tests/TailCallStructBig)
535                 stloc.1
536
537                 ldloca 0
538                 ldfld int32 Tests/TailCallStruct::a
539                 ldloca 0
540                 ldfld int32 Tests/TailCallStruct::b
541                 add
542                 ldloca 1
543                 ldfld int32 Tests/TailCallStructBig::a
544                 add
545                 ldc.i4 12
546                 sub
547                 ret
548         }
549
550         .method static public int32 tail3 (int32 i, int32 j) il managed {
551                 ldarg.0
552                 ldarg.1
553                 add
554                 ret
555         }
556
557         .method static public int32 tail4 (int32 i, int32 j) il managed {
558                 .maxstack 16
559                 .locals init (
560                         int32 k)
561
562                 // Test arg0 allocated to a register
563                 ldarg.0
564                 ldarg.0
565                 ldarg.0
566                 ldarg.0
567                 add
568                 add
569                 add
570                 starg 0
571
572                 // Test switched up argument variables as the actual arguments
573                 ldarg.1
574                 ldarg.0
575                 tail.
576                 call int32 Tests::tail3 (int32, int32)
577                 ret
578         }
579
580         .method static public int32 test_24_tail_calls2 () il managed {
581                 .maxstack 16
582                 .locals init (
583                         int32 i,
584                         int32 j)
585
586                 ldc.i4.4
587                 stloc.0
588                 ldc.i4.8
589                 stloc.1
590
591                 ldloc.0 
592                 ldloc.1
593                 call int32 Tests::tail4 (int32, int32)
594                 ret
595         }
596
597         .method public static int32 test_5_jmp () cil managed {
598                 ldc.i4.1
599                 ldc.i4.2
600                 call int32 Tests::jmp2 (int32, int32)
601                 ret
602         }
603
604         .method public static int32 jmp2 (int32, int32) cil managed {
605                 ldarg.0
606                 ldc.i4.1
607                 add
608                 starg.s 0
609                 ldarg.1
610                 ldc.i4.1
611                 add
612                 starg.s 1
613                 jmp int32 Tests::jmp3 (int32, int32)
614                 ldc.i4.0
615                 ret
616         }               
617
618         .method public static int32 jmp3 (int32 i, int32 j) cil managed {
619                 ldarg.0
620                 ldarg.1
621                 add
622                 ret
623         }
624
625         .method static public int32 test_11_switch_with_nonempty_stack () il managed {
626                 .maxstack 16
627
628                 ldc.i4.5
629                 ldc.i4.6
630                 ldc.i4.1
631                 switch (L0, L1)
632         L0: 
633                 add
634                 ret
635         L1:
636                 add
637                 ret
638         }
639  
640     .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
641                 .maxstack 16
642
643         .try {
644           leave IL_0
645         }
646         finally  {
647           ldc.i4.0
648           endfinally
649         }
650         IL_0:  ldc.i4.5
651                 ret
652     }
653
654         .method public static int32 test_0_conv_ovf_i8_neg () il managed {
655                 .maxstack 16
656
657                 ldc.i4.m1
658                 conv.ovf.i8
659                 conv.i4
660                 ldc.i4.m1
661                 beq L_OK
662                 ldc.i4.1
663                 ret
664         L_OK:
665                 ldc.i4.0
666                 ret
667         }               
668
669         .method public static int32 test_1234_conv_u4 () cil managed {
670                 .maxstack 16
671
672                 ldc.i4 1234
673                 conv.u4
674                 conv.i4
675                 ret
676         }
677
678         .method public static int32 test_0_conv_ovf_i_un () cil managed {
679                 .maxstack 16
680
681                 ldc.i4 1234
682                 conv.ovf.i.un
683                 conv.i4
684                 ldc.i4 1234
685                 beq L1
686                 ldc.i4.1
687                 ret
688         L1:
689                 ldc.i4 0x7fffffff
690                 conv.ovf.i.un
691                 conv.i4
692                 ldc.i4 0x7fffffff
693                 beq L2
694                 ldc.i4.2
695                 ret
696         L2:
697                 sizeof [mscorlib]System.IntPtr
698                 ldc.i4 8
699                 beq L5
700                 .try {
701                         ldc.i4 0x80000000
702                         conv.ovf.i.un
703                         leave L4
704                 } catch [mscorlib]System.OverflowException {
705                         pop
706                         leave L5
707                 }
708         L4: 
709                 ldc.i4.3
710                 ret
711         L5:
712                 ldc.i4.0
713                 ret
714         }
715
716         .method public static int32 test_0_conv_ovf_u_un () cil managed {
717                 .maxstack 16
718
719                 ldc.i4 1234
720                 conv.ovf.u.un
721                 conv.i4
722                 ldc.i4 1234
723                 beq L1
724                 ldc.i4.1
725                 ret
726         L1:
727                 ldc.i4.0
728                 ret
729         }
730
731         .method public static int32 test_0_conv_ovf_i () cil managed {
732                 .maxstack 16
733
734                 ldc.i4 1234
735                 conv.ovf.i
736                 conv.i4
737                 ldc.i4 1234
738                 beq L1
739                 ldc.i4.1
740                 ret
741         L1:
742                 ldc.i4.0
743                 ret
744         }
745
746         .method public static int32 test_0_conv_ovf_u () cil managed {
747                 .maxstack 16
748
749                 ldc.i4 1234
750                 conv.ovf.u
751                 conv.i4
752                 ldc.i4 1234
753                 beq L1
754                 ldc.i4.1
755                 ret
756         L1:
757                 ldc.i4.0
758                 ret
759         }
760
761         .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
762                 .maxstack 16
763
764                 ldc.i4 1234
765                 conv.ovf.i8.un
766                 conv.i4
767                 ret
768         }
769
770         .method public static int32 test_0_lconv_ovf_i () cil managed {
771                 .maxstack 16
772
773                 ldc.i4 1234
774                 conv.i8
775                 conv.ovf.i
776                 conv.i4
777                 ldc.i4 1234
778                 beq L1
779                 ldc.i4.1
780                 ret
781         L1:
782                 ldc.i4.0
783                 ret
784         }
785
786         .method public static int32 test_0_lconv_ovf_u () cil managed {
787                 .maxstack 16
788
789                 ldc.i4 1234
790                 conv.i8
791                 conv.ovf.u
792                 conv.i4
793                 ldc.i4 1234
794                 beq L1
795                 ldc.i4.1
796                 ret
797         L1:
798                 ldc.i4.0
799                 ret
800         }
801
802         .method public static int32 test_0_lconv_ovf_i_un () cil managed {
803                 .maxstack 16
804
805                 ldc.i4 1234
806                 conv.i8
807                 conv.ovf.i.un
808                 conv.i4
809                 ldc.i4 1234
810                 beq L1
811                 ldc.i4.1
812                 ret
813         L1:
814                 ldc.i4.0
815                 ret
816         }
817
818         .method public static int32 test_0_lconv_ovf_u_un () cil managed {
819                 .maxstack 16
820
821                 ldc.i4 1234
822                 conv.i8
823                 conv.ovf.u.un
824                 conv.i4
825                 ldc.i4 1234
826                 beq L1
827                 ldc.i4.1
828                 ret
829         L1:
830                 ldc.i4.0
831                 ret
832         }
833
834         .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
835                 .maxstack 16
836
837                 ldc.i4 1234
838                 conv.i8
839                 conv.ovf.u8.un
840                 conv.i4
841                 ldc.i4 1234
842                 beq L1
843                 ldc.i4.1
844                 ret
845         L1:
846                 ldc.i4.0
847                 ret
848         }
849
850         .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
851                 .maxstack 16
852                 .locals init (int32 res)
853
854                 ldc.i4 0x7fffffff
855                 conv.u8
856                 conv.ovf.i4.un
857                 pop
858
859                 ldc.i4.2
860                 stloc res
861
862         .try {
863                         ldc.i8 0x80000000
864                         conv.ovf.i4.un
865                         pop
866                         ldc.i4.0
867                         stloc res
868                         leave RET
869                 } catch [mscorlib]System.OverflowException {
870                         pop
871                         leave IL_0
872                 }
873
874         IL_0:
875
876         .try {
877                         ldc.i8 0xffffffff80000000
878                         conv.ovf.i4.un
879                         pop
880                         ldc.i4.1
881                         stloc res
882                         leave RET
883                 } catch [mscorlib]System.OverflowException {
884                         pop
885                         leave RET
886                 }
887
888         RET:
889                 ldloc res
890                 ret
891         }
892
893     .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
894                 .maxstack 16
895                 .locals init (int32 res)
896
897                 ldc.i4 0x7fffffff
898                 conv.u8
899                 conv.ovf.i.un
900                 conv.i4
901                 pop
902
903                 ldc.i4.1
904                 ret
905         }
906
907         .method public static int32 test_32_lconv_to_u8 () cil managed
908         {
909                 .maxstack 16
910
911                 ldc.i4 32
912                 conv.i8
913                 conv.u8
914                 conv.i4
915                 ret
916         }                               
917
918         .method public static int32 test_32_lconv_to_i8 () cil managed
919         {
920                 .maxstack 16
921
922                 ldc.i4 32
923                 conv.i8
924                 conv.i8
925                 conv.i4
926                 ret
927         }                               
928
929         .method public static int32 test_15_lconv_to_u () cil managed
930         {
931         ldc.i8 0x10000000f
932                 conv.u
933                 conv.i4
934                 ret
935         }
936
937 #if !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__)
938         // PPC handles overflow by clipping, but this test assumes
939         // no overflow handling.  According to ECMA the result of
940         // float->int conversion is undefined if overflow occurs, so
941         // both behaviours are valid.
942         .method public static int32 test_0_fconv_to_i () cil managed {
943                 .maxstack 16
944
945                 ldc.r8 2147483648.0
946                 conv.i
947                 ldc.i8 2147483648
948                 conv.i
949                 beq L1
950                 ldc.i4.1
951                 ret
952         L1:
953                 ldc.i4.0
954                 ret
955         }
956 #endif
957
958         .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
959         {
960                 .maxstack 16
961         
962                 ldc.i4.1
963                 brfalse OBJECT
964         
965                 ldtoken [mscorlib]System.String
966                 br AFTER
967         OBJECT:
968                 ldtoken [mscorlib]System.Object
969         AFTER:
970                 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
971                 callvirt instance string class [mscorlib]System.Type::get_FullName ()
972                 ldstr "System.String"
973                 callvirt instance bool class [mscorlib]System.Object::Equals(object)
974                 ldc.i4.0
975                 ceq
976                 ret 
977         }
978                 
979         .method public static int32 test_0_bug59580  ()
980         {
981                 ldc.r4          float32(0x7FC00000)
982                 ldc.r4          float32(0x7FC00000)
983                 bge.un          pass
984                 br              fail
985         pass:
986                 ldc.i4.0
987                 ret
988         fail:
989                 ldc.i4.1
990                 ret
991         }
992         
993         .method public static int32 test_1_bug60056  () {
994                 .locals init (int32 m5)
995                         
996                 ldc.i4.m1
997                 stloc.0
998                 
999                 ldc.i4.1
1000                 conv.u8
1001                 
1002                 ldloc.0
1003                 conv.i8
1004                 mul
1005                 
1006                 ldc.i4.m1
1007                 conv.i8
1008                 ceq
1009                 ret
1010         }
1011         
1012         .method public static int32 test_1_conv_u8_cfold  () {
1013                 ldc.i4.m1
1014                 conv.u8
1015                 
1016                 ldc.i8 0x00000000ffffffff
1017                 
1018                 ceq
1019                 ret
1020         }
1021         
1022         .method public static int32 test_1_array_type_mismatch_ldelema  () {
1023                 .locals init (int32 r)
1024                 
1025                         ldc.i4.1
1026                         newarr string
1027                         ldc.i4.0 
1028                         ldelema string
1029                         pop
1030                 
1031                 .try {
1032                         ldc.i4.1
1033                         newarr string
1034                         ldc.i4.0 
1035                         ldelema object
1036                         pop
1037                         
1038                         leave end
1039                 } catch [mscorlib]System.ArrayTypeMismatchException {
1040                         pop
1041                         ldc.i4.1
1042                         stloc.0
1043                         leave end
1044                 }
1045         end:
1046                 ldloc.0
1047                 ret
1048         }
1049
1050         .method public static int32 test_1_conv_ovf_i8_with_i4 () {
1051                         ldc.i4.m1 
1052                         conv.ovf.i8
1053                         conv.ovf.i4
1054                         neg
1055                         ret
1056         }
1057
1058         // bug #72148
1059     .method public static int32 test_0_initlocals_float_ptr () {
1060         .maxstack 3
1061         .locals init (
1062                 float32[]       V_0,
1063                 float32& pinned V_1,
1064                 unsigned int32  V_2)
1065                         ldc.i4.s 0x0f
1066                         newarr [mscorlib]System.Single
1067                         stloc.0 
1068                         ldloc.0 
1069                         ldc.i4.0 
1070                         ldc.r4 1.13
1071                         stelem.r4 
1072                         ldloc.0 
1073                         ldc.i4.0 
1074                         ldelema [mscorlib]System.Single
1075                         stloc.1 
1076                         ldloc.1 
1077                         conv.i 
1078                         ldind.u4 
1079                         stloc.2 
1080                         ldc.i4.0
1081                         ret
1082         }
1083
1084         .method public static int32 test_7_conv_ovf_u8_un () {
1085         .maxstack  2
1086         .locals    init (unsigned int64)
1087
1088         ldc.i4.7
1089         conv.ovf.u8.un
1090         stloc.0
1091                 ldloc.0
1092                 conv.i4
1093         ret
1094         }
1095
1096         .method public static int32 test_1_bug_74591 () {
1097                 .maxstack 16
1098                 .locals init (int32)
1099
1100                 ldc.i4.m1
1101                 stloc.0
1102                 ldloc.0
1103                 conv.ovf.i8
1104                 ldc.i4.m1
1105                 conv.ovf.i8
1106                 mul.ovf
1107                 conv.i4
1108                 ret
1109         }
1110
1111         .class nested public auto ansi Integer
1112                 extends [mscorlib]System.Object {
1113
1114                 .field public bool n
1115
1116             .method public hidebysig  specialname  rtspecialname 
1117            instance default void .ctor (unsigned int64 i, bool n)  cil managed 
1118             {
1119                         .maxstack 8
1120                         ldarg.0
1121                         call instance void class [mscorlib]System.Object::.ctor()
1122                         ldarg.0
1123                         ldarg.2
1124                         stfld bool Tests/Integer::n
1125                         ret
1126                 }
1127         }
1128
1129         .method public static int32 test_1_bug_74726 () {
1130                 .maxstack 16
1131
1132                 ldc.i4.2
1133                 conv.ovf.u8
1134                 ldc.i4.1
1135                 conv.ovf.u8
1136                 mul.ovf.un
1137                 ldc.i4.1
1138                 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
1139                 ldfld bool Tests/Integer::n
1140                 ldc.i4.1
1141                 ceq
1142                 ret
1143         }
1144
1145         .class nested private auto ansi sealed xxx
1146         extends [mscorlib]System.ValueType
1147    {
1148      .field  public   object a
1149
1150      .method public hidebysig  specialname  rtspecialname 
1151             instance default void .ctor ()  cil managed 
1152      {
1153                  .maxstack 8
1154                  ret 
1155      }
1156    } // end of class xxx
1157
1158         .method public static int32 test_0_newobj_vtype () {
1159                 .maxstack 6
1160                 .locals init (
1161                         valuetype Tests/xxx V_0
1162                 )
1163
1164                 newobj instance void valuetype Tests/xxx::.ctor ()
1165                 stloc.0
1166                 ldloca.s 0
1167                 ldfld object Tests/xxx::a
1168                 brfalse OK
1169                 ldc.i4.s 1
1170                 ret
1171         OK:
1172                 ldc.i4.s 0
1173                 ret
1174         }
1175
1176         .method public static int32 test_0_newobj_vtype_primitive () {
1177                 .maxstack 6
1178                 .locals init (
1179                         native int V_0
1180                 )
1181
1182                 ldc.i4.s 10
1183                 newobj instance void native int::'.ctor'(int32)
1184                 stloc.0
1185                 ldloc.0
1186                 ldc.i4.s 10
1187                 beq OK
1188                 ldc.i4.s 1
1189                 ret
1190         OK:
1191                 ldc.i4.s 0
1192                 ret
1193         }
1194
1195         .method public static int32 test_1_filters () {
1196                 .maxstack 16
1197                 .locals init (
1198                         int32 res
1199                 )
1200
1201                 .try { // 0
1202                         .try {
1203                                 ldstr "OnErrorSub test Exception"
1204                                 newobj instance void class [mscorlib]System.Exception::.ctor(string)
1205                                 throw 
1206                                 leave.s IL_0033
1207                         }
1208                         filter {
1209                                 pop
1210                                 ldc.i4.0
1211                                 endfilter
1212                         } {
1213                                 pop
1214                                 // Should not be called
1215                                 ldc.i4.2
1216                                 stloc res
1217                                 leave.s IL_0033
1218                         }
1219                 }
1220                 filter {
1221                         pop
1222                         ldc.i4.1
1223                         endfilter 
1224                 } {
1225                   pop
1226                   ldc.i4.1
1227                   stloc res       
1228                   leave.s IL_0033
1229
1230                 }
1231                 IL_0033:
1232                 ldloc res
1233                 ret
1234         }
1235
1236         .class nested private auto ansi sealed beforefieldinit TheStruct
1237                 extends [mscorlib]System.ValueType {
1238                 .field public int32 a
1239                 .field public int32 b
1240         }
1241
1242         .method public static int32 test_5_cpobj () {
1243                 .maxstack 8
1244                 .locals init (  
1245                                 valuetype Tests/TheStruct v_0, 
1246                                 valuetype Tests/TheStruct v_1
1247                                          )
1248
1249                 ldloca v_0
1250                 ldc.i4.2
1251                 stfld int32 Tests/TheStruct::a
1252
1253                 ldloca v_0
1254                 ldc.i4.3
1255                 stfld int32 Tests/TheStruct::b
1256
1257                 ldloca v_1
1258                 ldloca v_0
1259                 cpobj Tests/TheStruct
1260
1261                 ldloca v_1
1262                 ldfld int32 Tests/TheStruct::a
1263                 ldloca v_1
1264                 ldfld int32 Tests/TheStruct::b
1265                 add
1266
1267                 ret
1268         }
1269
1270         .method public static int32 test_5_ldobj_stloc_optimization () {
1271                 .maxstack 8
1272                 .locals init (  
1273                                 valuetype Tests/TheStruct v_0, 
1274                                 valuetype Tests/TheStruct v_1
1275                                          )
1276
1277                 ldloca v_0
1278                 ldc.i4.2
1279                 stfld int32 Tests/TheStruct::a
1280
1281                 ldloca v_0
1282                 ldc.i4.3
1283                 stfld int32 Tests/TheStruct::b
1284
1285                 ldloca v_0
1286                 ldobj valuetype Tests/TheStruct
1287                 stloc.s v_1
1288
1289                 ldloca v_1
1290                 ldfld int32 Tests/TheStruct::a
1291                 ldloca v_1
1292                 ldfld int32 Tests/TheStruct::b
1293                 add
1294
1295                 ret
1296         }
1297
1298         .method public static int32 test_1_cpobj_reference () {
1299                 .maxstack 8
1300                 .locals init (  
1301                                 object v_0, 
1302                                 object v_1
1303                                          )
1304
1305                 newobj instance void object::.ctor()
1306                 stloc v_0
1307
1308                 ldloca v_1
1309                 ldloca v_0
1310                 cpobj object
1311
1312                 ldloc v_0
1313                 ldloc v_1
1314                 ceq
1315                 ret
1316         }
1317
1318         .method public static int32 test_1_initobj_reference () {
1319                 .maxstack 8
1320                 .locals init (  
1321                                 object v_0
1322                                          )
1323
1324                 newobj instance void object::.ctor()
1325                 stloc v_0
1326
1327                 ldloca v_0
1328                 initobj object
1329
1330                 ldloc v_0
1331                 ldnull
1332                 ceq
1333                 ret
1334         }
1335
1336         .method public static int32 test_1_ldobj_reference () {
1337                 .maxstack 8
1338                 .locals init (  
1339                                 object v_0
1340                                          )
1341
1342                 newobj instance void object::.ctor()
1343                 stloc v_0
1344
1345                 ldloc v_0
1346                 ldloca v_0
1347                 ldobj object
1348                 ceq
1349                 ret
1350         }
1351
1352         .method public static int32 test_5_vtype_on_bb_boundary () {
1353                 .maxstack 8
1354                 .locals init (  
1355                                 valuetype Tests/TheStruct v_0, 
1356                                 valuetype Tests/TheStruct v_1
1357                                          )
1358
1359                 ldloca v_0
1360                 ldc.i4.2
1361                 stfld int32 Tests/TheStruct::a
1362
1363                 ldloca v_0
1364                 ldc.i4.3
1365                 stfld int32 Tests/TheStruct::b
1366
1367                 ldloc v_0
1368                 br L_0
1369         L_0: stloc v_1
1370
1371                 ldloca v_1
1372                 ldfld int32 Tests/TheStruct::a
1373                 ldloca v_1
1374                 ldfld int32 Tests/TheStruct::b
1375                 add
1376                 ret
1377         }
1378
1379         .method public static int32 test_5_different_in_stacks () cil managed {
1380                 .maxstack 16
1381
1382                         ldc.i4.1
1383                         ldc.i4.1
1384                         beq L_0
1385
1386                         ldc.i4.3
1387                         ldc.i4.3
1388                         br L_1
1389                         ldc.i4.3
1390                         ldc.i4.3
1391                         br L_2
1392          L_0:   ldc.i4.2
1393                         ldc.i4.3
1394                         ldc.i4.1
1395                         ldc.i4.1
1396                         beq L_2
1397          L_1:   add
1398                         ret
1399          L_2:   add
1400                         ret
1401         }
1402
1403         .method public static int32 test_3_larray_get_set () {
1404                 .locals init (
1405                         int32[2]        V_0)
1406                           
1407                         ldc.i4.2 
1408                         newobj instance void int32[0...]::.ctor(int32)
1409                         stloc.0 
1410                         ldloc.0 
1411                         ldc.i4.0 
1412                         ldc.i4 1
1413                         call instance void int32[0...]::Set(int32, int32)
1414                     ldloc.0 
1415                     ldc.i4.1 
1416                         ldc.i4 2
1417                         call instance void int32[0...]::Set(int32, int32)
1418
1419                         ldloc.0
1420                         ldc.i4.0
1421                         call instance int32 int32[0...]::Get(int32)
1422                         ldloc.0
1423                         ldc.i4.1
1424                         call instance int32 int32[0...]::Get(int32)
1425                         add
1426                         ret
1427         }
1428
1429         .method public static int32 test_0_pop_side_effects () {
1430                 .try {
1431                         ldc.r8 1
1432                         ldc.r8 0
1433                         div
1434                         ckfinite
1435                         pop
1436                         leave FAIL
1437                 }
1438                 catch [mscorlib]System.ArithmeticException {
1439                         pop
1440                         leave L_0
1441                 }
1442                 L_0:
1443                 ldc.i4.0
1444                 ret
1445                 FAIL:
1446                 ldc.i4.1
1447                 ret
1448         }
1449
1450         .method public static void regalloc_regress_78314_helper (object o) cil managed
1451         {
1452                 ret
1453         }
1454
1455         .method public static int32 test_1_regalloc_regress_78314 () cil managed
1456         {
1457     // Code size       68 (0x44)
1458     .maxstack  6
1459     .locals init (int32 V_0, bool V_1)
1460     IL_0000:  ldc.i4.0
1461     IL_0001:  stloc.0
1462     IL_0002:  br.s       IL_003b
1463
1464     IL_0004:
1465     IL_001e:  ldc.i4.s   10
1466     IL_0020:  ldloc.0
1467     IL_0021:  shl
1468     IL_0022:  ldc.i4.s   10
1469     IL_0024:  ldloc.0
1470     IL_0025:  shl
1471     IL_0026:  ceq
1472     IL_0028:  box        [mscorlib]System.Boolean
1473     IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
1474     IL_0037:  ldloc.0
1475     IL_0038:  ldc.i4.1
1476     IL_0039:  add
1477     IL_003a:  stloc.0
1478     IL_003b:  ldloc.0
1479     IL_003c:  ldc.i4.8
1480     IL_003f:  blt.s      IL_0004
1481
1482         ldloc.0
1483         ldc.i4.8
1484         ceq
1485         conv.i4
1486         ret     
1487   }
1488
1489         .method public static void try_block_end_remove_if_useless () cil managed {
1490             .maxstack  8
1491
1492             T_START:
1493                 ldstr   "Start"
1494                         pop
1495                 leave.s COMPLETE
1496             T1_END:
1497
1498             COMPLETE:
1499                 ret
1500
1501             F1_START:
1502                 ldstr   "Finally1"
1503                         pop
1504                 endfinally
1505             F1_END:
1506
1507             .try T_START to T1_END finally handler F1_START to F1_END
1508         }
1509
1510         .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1511                 call void class Tests::try_block_end_remove_if_useless ()
1512                 ldc.i4.0
1513                 ret
1514         }
1515
1516    .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
1517     {
1518         ldc.i4.0
1519         switch (target)
1520         target: ldstr "bar"
1521                 pop
1522                 ldc.i4.0
1523         ret
1524     }
1525
1526         // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1527         // generate the non .un version of the opcodes
1528     .method private static  hidebysig 
1529            default int32 test_4_float_branch_nan ()  cil managed 
1530     {
1531         // Method begins at RVA 0x27a4
1532         // Code size 74 (0x4a)
1533         .maxstack 2
1534         .locals init (
1535                 float64 V_0,
1536                 float64 V_1,
1537                 int32   V_2)
1538         IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
1539         IL_0009:  stloc.0 
1540         IL_000a:  ldc.r8 1.
1541         IL_0013:  stloc.1 
1542         IL_0014:  ldc.i4.0 
1543         IL_0015:  stloc.2 
1544         IL_0016:  ldloc.0 
1545         IL_0017:  ldloc.1 
1546         IL_0018:  bge.s IL_001a
1547
1548                                 br L1
1549         IL_001a:  ldloc.2 
1550         IL_001b:  ret 
1551         L1:
1552         IL_001c:  ldloc.2 
1553         IL_001d:  ldc.i4.1 
1554         IL_001e:  add 
1555         IL_001f:  stloc.2 
1556         IL_0020:  ldloc.0 
1557         IL_0021:  ldloc.1 
1558         IL_0022:  ble.s IL_002e
1559                                 br L2
1560         IL_002e:  ldloc.2 
1561         IL_002f:  ret 
1562         L2:
1563         IL_0030:  ldloc.2 
1564         IL_0031:  ldc.i4.1 
1565         IL_0032:  add 
1566         IL_0033:  stloc.2 
1567         IL_0034:  ldloc.0 
1568         IL_0035:  ldloc.1 
1569         IL_0036:  blt.s IL_0038
1570                                 br L3           
1571         IL_0038:  ldloc.2 
1572         IL_0039:  ret 
1573         L3:
1574         IL_003a:  ldloc.2 
1575         IL_003b:  ldc.i4.1 
1576         IL_003c:  add 
1577         IL_003d:  stloc.2 
1578         IL_003e:  ldloc.0 
1579         IL_003f:  ldloc.1 
1580         IL_0040:  bgt.s IL_0042
1581                                 br L4
1582         IL_0042:  ldloc.2 
1583         IL_0043:  ret 
1584         L4:
1585         IL_0044:  ldloc.2 
1586         IL_0045:  ldc.i4.1 
1587         IL_0046:  add 
1588         IL_0047:  stloc.2 
1589         IL_0048:  ldloc.2 
1590         IL_0049:  ret 
1591     } // end of method Tests::test_5_float_branch_nan
1592
1593     .method private static  hidebysig
1594            default void regress_80622_inner (object x)  cil managed
1595     {
1596                 .locals (unsigned int8 i)
1597         // Method begins at RVA 0x2050
1598         // Code size 14 (0xe)
1599         .maxstack 8
1600         IL_1000:  ldarg.0
1601         IL_1001:  unbox unsigned int8
1602         IL_1006:  ldobj unsigned int8
1603         IL_000b:  conv.ovf.i4.un
1604         IL_000c:  pop
1605         IL_000d:  ret
1606     }
1607
1608     // method line 2
1609     .method private static  hidebysig
1610            default int32 test_0_regress_80622 ()  cil managed
1611     {
1612         .maxstack 8
1613         IL_0000:  ldc.i4 255
1614         IL_0005:  box unsigned int8
1615         IL_000a:  call void class Tests::regress_80622_inner (object)
1616                 ldc.i4.0
1617         IL_000f:  ret
1618     }
1619
1620         .method private static default int32 test_0_regresss_80190 () cil managed
1621         {
1622             .maxstack  2
1623             .locals init (int32 V_0,
1624                      int32* V_1)
1625             IL_0000:  nop
1626             IL_0001:  nop
1627             IL_0002:  ldloca.s   V_0
1628             IL_0004:  conv.u
1629             IL_0005:  stloc.1
1630             IL_0006:  ldloc.1
1631             IL_0007:  ldc.i4.3
1632             IL_0008:  stind.i4
1633             IL_0009:  nop
1634                                   ldc.i4.0
1635                                   ret
1636         }
1637
1638         .class interface nested public auto ansi abstract IFaceWithStaticMethod
1639         {
1640             .method public static  specialname 
1641                default void foo ()  cil managed noinlining 
1642             {
1643                 .maxstack 0
1644                 IL_0000:  ret 
1645         }
1646         }
1647         
1648         .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1649         {
1650             .method public hidebysig  specialname  rtspecialname 
1651            instance default void .ctor ()  cil managed 
1652             {
1653                         .maxstack 8
1654                         ret
1655                 }
1656
1657         }
1658
1659         // Test that static methods in interfaces are ignored during vtable construction
1660         .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1661         {
1662                 .maxstack 16
1663
1664                 newobj instance void class Tests/AClass::.ctor()
1665                 pop
1666                 ldc.i4.0
1667                 ret
1668         }
1669
1670         .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
1671                 ldarg.0
1672                 box !!0
1673                 brtrue HAS_VALUE
1674                 ldc.i4.0
1675                 ret
1676 HAS_VALUE:      ldc.i4.1
1677                 ret
1678         }
1679
1680         // bug 78019
1681         .method static public int32 test_0_nullable_box_brtrue () cil managed {
1682
1683                 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1684
1685                 ldloc.0
1686                 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1687                 ret
1688         }
1689
1690         //Bug 372410
1691         .method static public int32 test_0_ldelema_type_check () cil managed {
1692                 .maxstack 16
1693                 .locals init (object[] V_0,
1694                                           object[,] V_1)
1695
1696                 ldc.i4.1
1697                 newarr object
1698                 stloc.0
1699
1700                 .try {
1701                         ldloc.0
1702                         ldc.i4.0
1703                         ldelema object
1704                         leave L1
1705                 } catch [mscorlib]System.ArrayTypeMismatchException {
1706                         leave ERROR1
1707                 }
1708
1709         L1:
1710                 ldc.i4.1
1711                 newarr string
1712                 stloc.0
1713
1714                 .try {
1715                         ldloc.0
1716                         ldc.i4.0
1717                         ldelema object
1718                         leave ERROR2
1719                 } catch [mscorlib]System.ArrayTypeMismatchException {
1720                         leave L2
1721                 }
1722
1723         L2:
1724                         ldc.i4.1
1725                 newarr string
1726                 stloc.0
1727
1728                 .try {
1729                         ldloc.0
1730                         ldc.i4.0
1731                         readonly. ldelema object
1732                         leave L3
1733                 } catch [mscorlib]System.ArrayTypeMismatchException {
1734                         leave ERROR3
1735                 }
1736
1737         L3:
1738                 ldc.i4.0
1739                 ret
1740
1741
1742         ERROR1:
1743                 ldc.i4.1
1744                 ret
1745
1746         ERROR2:
1747                 ldc.i4.2
1748                 ret
1749
1750         ERROR3:
1751                 ldc.i4.3
1752                 ret
1753         }
1754
1755
1756         //Bug 372410
1757         .method static public int32 test_0_array_address_type_check () cil managed {
1758                 .maxstack 16
1759                 .locals init (object[] V_0,
1760                                           object[,] V_1)
1761
1762                 ldc.i4.1 
1763             ldc.i4.1 
1764             newobj instance void object[,]::.ctor(int32, int32)
1765                 stloc.1
1766
1767                 .try {
1768                         ldloc.1
1769                         ldc.i4.0
1770                         ldc.i4.0
1771                         call instance object&  object[,]::Address(int32, int32)
1772                         leave L4
1773                 } catch [mscorlib]System.ArrayTypeMismatchException {
1774                         leave ERROR4
1775                 }
1776
1777         L4:
1778                 ldc.i4.1 
1779             ldc.i4.1 
1780             newobj instance void string[,]::.ctor(int32, int32)
1781                 stloc.1
1782
1783                 .try {
1784                         ldloc.1
1785                         ldc.i4.0
1786                         ldc.i4.0
1787                         call instance object&  object[,]::Address(int32, int32)
1788                         leave ERROR5
1789                 } catch [mscorlib]System.ArrayTypeMismatchException {
1790                         leave L5
1791                 }
1792
1793         L5:
1794                 ldc.i4.1 
1795             ldc.i4.1 
1796             newobj instance void string[,]::.ctor(int32, int32)
1797                 stloc.1
1798
1799                 .try {
1800                         ldloc.1
1801                         ldc.i4.0
1802                         ldc.i4.0
1803                         readonly. call instance object&  object[,]::Address(int32, int32)
1804                         leave L6
1805                 } catch [mscorlib]System.ArrayTypeMismatchException {
1806                         leave ERROR6
1807                 }
1808
1809         L6:
1810                 ldc.i4.0
1811                 ret
1812         ERROR4:
1813                 ldc.i4.4
1814                 ret
1815
1816         ERROR5:
1817                 ldc.i4.5
1818                 ret
1819
1820         ERROR6:
1821                 ldc.i4.6
1822                 ret
1823         }
1824
1825         .field public  static unsigned int64 'ull'
1826
1827         .field public  static int32 'shift2'
1828
1829         .method public static int32 test_0_long_shift_regalloc () cil managed
1830         {
1831                 .locals (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
1832
1833                 .maxstack 4
1834
1835                 ldc.i8  81985529234382576
1836                 stsfld  unsigned int64 Tests::ull
1837             ldc.i4      60
1838                 stsfld  int32 Tests::shift2
1839
1840                 ldsfld  unsigned int64 Tests::ull
1841                 stloc   'cilsimp.27'
1842                 ldsfld  int32 Tests::shift2
1843                 stloc   'cilsimp.28'
1844                 ldloc   'cilsimp.27'
1845                 ldloc   'cilsimp.28'
1846                 shr.un
1847                 ldloc   'cilsimp.27'
1848                 ldc.i4  64
1849                 ldloc   'cilsimp.28'
1850                 sub
1851                 shl
1852                 or
1853                 ldc.i8  1311768467750121216
1854                 ceq
1855                 ldc.i4.1
1856                 xor
1857                 conv.u4
1858                 ret
1859         }
1860
1861         // Test calling ldfld directly on a vtype instead of a vtype address
1862         .method public static int32 test_5_call_ldfld_vtype () cil managed
1863         {
1864                 .maxstack 16
1865                 .locals init (
1866                         valuetype Tests/TailCallStruct arg
1867                 )
1868                 ldloca 0
1869                 ldc.i4.2
1870                 stfld int32 Tests/TailCallStruct::a
1871                 ldloca 0
1872                 ldc.i4.4
1873                 stfld int32 Tests/TailCallStruct::b
1874                 ldloc.0
1875                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
1876                 ldfld int32 Tests/TailCallStruct::a
1877                 ret
1878         }
1879
1880         .method public static int32 throw_ret () cil managed
1881         {
1882                 ldstr "FOO"
1883                 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
1884                 throw
1885                 ldc.i4.4
1886                 ret
1887         }
1888
1889         .method public static int32 throw2_ret () cil managed
1890         {
1891                 // Disable inlining
1892                 ldc.i4.5
1893                 localloc
1894                 pop
1895
1896                 call int32 Tests::throw_ret ()
1897                 ret
1898         }
1899
1900         // Test inlining a method which contains just a throw
1901         .method public static int32 test_0_inline_throw () cil managed
1902         {
1903                 .maxstack 16
1904                 .locals init (
1905                                 int32 v_0
1906                 )
1907
1908                 .try {
1909                         call int32 Tests::throw2_ret ()
1910                         stloc.0
1911                         leave L0
1912                 } catch [mscorlib]System.OverflowException {
1913                         pop
1914                         leave L1
1915                 }
1916
1917                 L0:
1918                         ldc.i4.1
1919                         ret
1920                 L1:
1921                         ldc.i4.0
1922                         ret                     
1923         }
1924
1925     .method public static int32 test_0_stelem_any_null_opt () cil managed
1926     {
1927                 .maxstack 16
1928                 .locals init (
1929                                 object[]        V_0,
1930                                 int32   V_1)
1931
1932                 ldc.i4.s 10
1933                 newarr [mscorlib]System.Object
1934                 stloc.0
1935
1936                 ldc.i4.0
1937                 stloc.1
1938                 br L0
1939
1940         L1:
1941                 ldloc.0
1942                 ldloc.1
1943                 ldnull
1944                 stelem.any [mscorlib]System.Object
1945                 ldloc.1
1946                 ldc.i4.1
1947                 add
1948                 stloc.1
1949         L0:
1950                 ldloc.1
1951                 ldc.i4.s 10
1952                 blt L1
1953
1954                 ldc.i4.0
1955                 ret
1956         }
1957
1958     // method line 2
1959     .method public static  hidebysig 
1960            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 
1961     {
1962         // Method begins at RVA 0x20f4
1963         // Code size 44 (0x2c)
1964         .maxstack 8
1965         IL_0000:  ldarg.0 
1966         IL_0001:  ldarg.1 
1967         IL_0002:  add 
1968         IL_0003:  ldarg.2 
1969         IL_0004:  add 
1970         IL_0005:  ldarg.3 
1971         IL_0006:  add 
1972         IL_0007:  ldarg.s 4
1973         IL_0009:  add 
1974         IL_000a:  ldarg.s 5
1975         IL_000c:  add 
1976         IL_000d:  ldarg.s 6
1977         IL_000f:  add 
1978         IL_0010:  ldarg.s 7
1979         IL_0012:  add 
1980         IL_0013:  ldarg.s 8
1981         IL_0015:  add 
1982         IL_0016:  ldarg.s 9
1983         IL_0018:  add 
1984         IL_0019:  ldarg.s 10
1985         IL_001b:  add 
1986         IL_001c:  ldarg.s 11
1987         IL_001e:  add 
1988         IL_001f:  ldarg.s 12
1989         IL_0021:  add 
1990         IL_0022:  ldarg.s 13
1991         IL_0024:  add 
1992         IL_0025:  ldarg.s 14
1993         IL_0027:  add 
1994         IL_0028:  ldarg.s 15
1995         IL_002a:  add 
1996         IL_002b:  ret 
1997     } // end of method main::callee
1998
1999     // method line 3
2000     .method public static  hidebysig 
2001            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 
2002     {
2003         // Method begins at RVA 0x2124
2004         // Code size 34 (0x22)
2005         .maxstack 17
2006         IL_0000:  ldarg.0 
2007         IL_0001:  ldarg.1 
2008         IL_0002:  ldarg.2 
2009         IL_0003:  ldarg.3 
2010         IL_0004:  ldarg.s 4
2011         IL_0006:  ldarg.s 5
2012         IL_0008:  ldarg.s 6
2013         IL_000a:  ldarg.s 7
2014         IL_000c:  ldarg.s 8
2015         IL_000e:  ldarg.s 9
2016         IL_0010:  ldarg.s 10
2017         IL_0012:  ldarg.s 11
2018         IL_0014:  ldarg.s 12
2019         IL_0016:  ldarg.s 13
2020         IL_0018:  ldarg.s 14
2021         IL_001a:  ldarg.s 15
2022                   tail.
2023         IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
2024         IL_0021:  ret 
2025     } // end of method main::caller
2026
2027     // method line 4
2028     .method public static  hidebysig 
2029            default int32 test_0_many_args_tail_call ()  cil managed 
2030     {
2031         // Method begins at RVA 0x2154
2032         // Code size 43 (0x2b)
2033         .maxstack 17
2034         IL_0000:  ldc.i4.1 
2035         IL_0001:  ldc.i4.2 
2036         IL_0002:  ldc.i4.3 
2037         IL_0003:  ldc.i4.4 
2038         IL_0004:  ldc.i4.5 
2039         IL_0005:  ldc.i4.6 
2040         IL_0006:  ldc.i4.7 
2041         IL_0007:  ldc.i4.8 
2042         IL_0008:  ldc.i4.s 0x09
2043         IL_000a:  ldc.i4.s 0x0a
2044         IL_000c:  ldc.i4.s 0x0b
2045         IL_000e:  ldc.i4.s 0x0c
2046         IL_0010:  ldc.i4.s 0x0d
2047         IL_0012:  ldc.i4.s 0x0e
2048         IL_0014:  ldc.i4.s 0x0f
2049         IL_0016:  ldc.i4.s 0x10
2050         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)
2051         IL_001d:  ldc.i4 136
2052         IL_0022:  beq IL_0029
2053
2054         IL_0027:  ldc.i4.1 
2055         IL_0028:  ret 
2056         IL_0029:  ldc.i4.0 
2057         IL_002a:  ret 
2058     } // end of method main::Main
2059
2060         .class nested private auto ansi beforefieldinit R1
2061            extends [mscorlib]System.MarshalByRefObject
2062         {
2063                 .field  public  int32 test_field
2064
2065         .method public hidebysig  specialname  rtspecialname
2066                         instance default void '.ctor' ()  cil managed
2067         {
2068                         ret
2069                 }
2070         }
2071
2072         .method public static hidebysig
2073                         default int32 return_0 () cil managed
2074         {
2075                 ldc.i4.0
2076                 ret
2077         }
2078
2079         .method public static hidebysig
2080                         default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2081         {
2082                 .locals init (
2083                         class Tests/R1 v_0
2084                 )
2085
2086                 newobj instance void class Tests/R1::.ctor ()
2087                 stloc.0
2088                 ldloc.0
2089                 ldc.i4.0
2090                 volatile.
2091                 stfld int32 Tests/R1::test_field
2092                 call int32 class Tests::return_0 ()
2093                 ldc.i4.1
2094                 add
2095                 ret
2096         }
2097
2098         .method public static default int32 return_2 () cil managed
2099         {
2100                 // Prevent inlining
2101                 ldc.i4.s 16
2102         localloc
2103                 pop
2104                 ldc.i4.s 2
2105                 ret
2106         }
2107
2108         .method public static hidebysig
2109                         default int32 test_1_cmov_opt_regress_463357 () cil managed
2110         {
2111                 call int32 class Tests::return_2 ()
2112                 ldc.i4.0
2113                 ceq
2114                 brfalse L1
2115                 ldc.i4.0
2116                 ret
2117                 br L2
2118         L1: nop
2119         L2: nop
2120                 ldc.i4.1
2121                 ret
2122         }
2123
2124    .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1)  cil managed 
2125    {
2126       .maxstack 3
2127       .locals init (int32 V_0, bool V_1, bool V_2)
2128       
2129           ldc.i4.0
2130       IL_000b:  stloc.1 
2131       IL_000d:  br IL_002f
2132
2133           ldc.i4.1    
2134           stloc.2
2135       IL_001e:  ldloc.2 
2136       IL_001f:  brfalse IL_0036
2137
2138       IL_0024:  
2139       IL_002a:  br IL_0041
2140     
2141       IL_002f:  ldloc.1
2142       IL_0030:  stloc.2 
2143       IL_0031:  br IL_001e
2144     
2145       IL_0036:  ldc.i4 0
2146       IL_003b:  stloc.0 
2147       IL_003c:  br IL_0041
2148     
2149       IL_0041:  ldloc.0 
2150       IL_0042:  ret 
2151   } 
2152
2153     .method public static default int32 test_0_cmov_opt_regress_474718 ()  cil managed 
2154     {
2155         .maxstack 16
2156         ldc.i4.1
2157         call int32 Tests::cmov_opt_regress_474718_inner (int32)
2158         ret
2159    }
2160
2161         .method public static default int32 test_5_createarr_newobj () cil managed
2162         {
2163                 .maxstack 16
2164
2165                 ldc.i4 5
2166                 newobj void char[]::.ctor(int32)
2167                 ldlen
2168                 ret
2169         }
2170
2171         .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
2172         {
2173                 .maxstack 16
2174                 .locals init (native int)
2175
2176                 ldc.i4.s 10
2177                 localloc
2178                 stloc.0
2179
2180                 // Set the first value to 3
2181                 ldloc.0
2182                 ldc.i4.0
2183                 add             //addr
2184                 ldc.i4.3        //value
2185                 stind.i1
2186
2187                 // Zero out the first 3 values
2188                 ldloc.0         //addr
2189                 ldc.i4.0        //value
2190                 ldc.i4.s 3      //size
2191                 initblk
2192
2193                 // Load the first value
2194                 ldloc.0
2195                 ldc.i4.0
2196                 add     
2197                 ldind.u1
2198                 conv.i4
2199                 ret
2200         }
2201
2202         .method public static float32 GetFloat32() cil managed noinlining
2203         {
2204                 .maxstack  8
2205                 ldc.r8     0.19975845134874831
2206                 ret
2207         }
2208
2209 /*         Disabled until they can be fixed to run on amd64
2210         .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
2211         {
2212                 .maxstack 16
2213
2214                 call float32 Tests::GetFloat32()
2215                 ldc.r8     0.19975845134874831
2216                 beq OK
2217
2218                 ldc.i4.1
2219                 ret
2220 OK:
2221                 ldc.i4.0
2222                 ret
2223         }
2224 */
2225 }