[interp] add iltests.exe to regression suite and mark crashing tests
[mono.git] / mono / mini / iltests.il
1 .assembly iltests {
2   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
3                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
4                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
5 }
6 .assembly extern TestDriver {}
7 .assembly extern mscorlib {}
8
9 .class public auto ansi sealed beforefieldinit Tests {
10
11         .method static public int32 Main(string[] args) il managed {
12                 .entrypoint
13                 
14                 ldtoken Tests
15                 call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
16                 ldarg.0
17                 call       int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type, string[])
18                 ret
19         }
20
21         // make sure the register allocator works when the return value of
22         // 'div' is discarded
23         .method static public int32 test_0_div_regalloc () il managed {
24                 .locals init (
25                         int32 i
26                 )
27
28                 ldloc 0
29                 ldc.i4.s 0xa
30                 div
31                 pop
32                 ldc.i4.0
33                 ret
34         }
35         
36         
37         .method static public int32 test_1_ceq_to_i4 () il managed {
38                 .locals init (
39                         int32   foo
40                 )
41                 ldc.i4 500
42                 stloc foo
43                 ldloc foo
44                 ldc.i4 500
45                 ceq
46                 stloc foo
47                 ldloc foo
48                 ret
49         }
50         
51         .method static public int32 test_3_shl_regvars () il managed {
52                 .locals init (
53                         int32   a,
54                         int32   b,
55                         int32   r1,
56                         int32   r2,
57                         int32   r3
58                 )
59                         
60                 ldc.i4.2
61                 stloc      a
62                 ldc.i4.1
63                 stloc      b
64         
65                 ldloc      a
66                 ldloc      b
67                 shl 
68                 stloc      r1
69                 
70                 ldloc      a
71                 ldloc      b
72                 shl 
73                 stloc      r2
74                 
75                 ldloc      a
76                 ldloc      b
77                 shl 
78                 stloc      r3
79                 
80                 ldloc      r1
81                 ldc.i4.4
82                 ceq
83                 
84                 ldloc      r2
85                 ldc.i4.4
86                 ceq
87                 
88                 ldloc      r3
89                 ldc.i4.4
90                 ceq
91                 
92                 add
93                 add
94                 
95                 ret
96         }
97         
98         .method static public int32 test_1_fceq_to_i4 () il managed {
99         
100                 .locals init (
101                         float64 foo,
102                         int32   val
103                 )
104
105                 ldc.r8      2
106                 stloc       foo
107                 
108                 ldloc       foo
109                 ldc.r8      2
110                 ceq
111                 stloc       val
112                 
113                 ldloc       val
114                 ret
115         }
116
117         //
118         // This should be manually checked. Basically under -O=linears,
119         // you should not see tons of register spilling.
120         //
121         .method static public int32 test_1_bytedreg_free () il managed {
122                 .locals init (
123                         int32   foo
124                 )
125                 ldc.i4 500
126                 stloc foo
127                 ldloc foo
128                 ldc.i4 500
129                 ceq
130                 stloc foo
131                 
132                 ldloc foo
133                 ldc.i4 1
134                 ceq
135                 stloc foo
136
137                 ldloc foo
138                 ldc.i4 1
139                 ceq
140                 stloc foo
141
142                 ldloc foo
143                 ldc.i4 1
144                 ceq
145                 stloc foo
146                 
147                 ldloc foo
148                 ldc.i4 1
149                 ceq
150                 stloc foo
151                 
152                 ldloc foo
153                 ret
154         }
155         
156         //
157         // This should be manually checked. Basically under -O=linears,
158         // you should not see tons of register spilling.
159         //
160         .method static public int32 test_0_bytesreg1_free () il managed {
161                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
162                 .locals init (
163                         unsigned int8      dest,
164                         int32              src,
165                         unsigned int8&     pdest
166                 )
167
168                 ldloca     dest
169                 stloc      pdest
170                 
171                 ldloc      pdest
172                 ldloc      src
173                 stind.i1
174                 
175                 ldloc      pdest
176                 ldloc      src
177                 stind.i1
178                 
179                 ldloc      pdest
180                 ldloc      src
181                 stind.i1
182                 
183                 ldloc      pdest
184                 ldloc      src
185                 stind.i1
186                 
187                 ldloc      pdest
188                 ldloc      src
189                 stind.i1
190                 
191                 ldloc      pdest
192                 ldloc      src
193                 stind.i1
194                 
195                 ldloc      pdest
196                 ldind.i1
197                 ret
198         }
199         
200         .method static public int32 test_1_shift_regvar () il managed {
201         
202                 .locals init (
203                         int32   v7FFFFFFF,
204                         int32   v1
205                 )
206                 
207                 ldc.i4  0x7FFFFFFF
208                 stloc   v7FFFFFFF
209         
210                 ldc.i4.1
211                 stloc v1
212                 
213                 ldloc   v7FFFFFFF
214                 ldloc   v1
215                 shl
216                 ldc.i4  0xFFFFFFFE
217                 ceq
218                 ret
219         }
220         
221         // this only happens with the managed pointer, not an unmanaged one.
222         .method static public int32 test_0_foo () il managed {
223                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
224         
225                 .locals init (
226                         int32&  buf
227                 )
228                 
229                 ldc.i4.5
230                 localloc
231                 
232                 stloc buf
233                 ldloc buf
234                 
235                 ldind.i4
236                 
237                 ret
238         }
239
240         .method static public int32 test_0_localloc () cil managed {
241                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
242                 .locals init (native int, native int, native int, native int, int32)
243
244                 ldc.i4 6
245                 localloc
246                 conv.i
247                 stloc.0
248
249                 ldc.i4 6
250                 localloc
251                 conv.i
252                 stloc.1
253
254                 ldc.i4 6
255                 localloc
256                 conv.i
257                 stloc.2
258
259                 // Variable length
260                 ldc.i4 128
261                 stloc.s 4
262                 ldloc.s 4
263                 localloc
264                 conv.i
265                 stloc.3
266
267                 // Check zero initialized
268                 ldloc.0
269                 ldind.i4
270                 ldc.i4.0
271                 beq OK1
272                 ldc.i4.1
273                 br FAIL
274
275 OK1:
276                 ldloc.3
277                 ldind.i4
278                 ldc.i4.0
279                 beq OK2
280                 ldc.i4.2
281                 br FAIL
282
283 OK2:
284                 ldloc.3
285                 ldc.i4.s 124
286                 add
287                 ldind.i4
288                 ldc.i4.0
289                 beq OK3
290                 ldc.i4.3
291                 br FAIL
292
293 OK3:
294                 ldloc.1
295                 ldc.i4 999999
296                 stind.i4
297                 ldloc.1
298                 ldind.i4
299                 ldc.i4 999999
300                 beq OK4
301                 ldc.i4.4
302                 br FAIL
303
304 OK4:
305                 ldloc.0
306                 ldc.i4 999999
307                 stind.i4
308                 ldloc.0
309                 ldind.i4
310                 ldc.i4 999999
311                 beq OK5
312                 ldc.i4.5
313                 br FAIL
314
315 OK5:
316                 // Try allocations bigger than one page
317                 ldc.i4 8196
318                 localloc
319                 conv.i
320                 stloc.3
321                 ldloc.3
322                 ldc.i4 8192
323                 add
324                 ldc.i4 99
325                 stind.i4
326                 ldloc.3
327                 ldc.i4 8192
328                 add
329                 ldind.i4
330                 ldc.i4 99
331                 beq PASS
332                 ldc.i4.6
333                 br FAIL
334
335 FAIL:
336                 ret
337
338 PASS:   ldc.i4.0
339                 ret
340         }
341
342     .method private static void do_localloc () cil managed {
343         .maxstack 3
344         .locals init (
345                 unsigned int8*  V_0)
346         IL_0000:  ldc.i4.1
347         IL_0001:  ldc.i4 131072
348         IL_0006:  mul
349         IL_0007:  localloc
350         IL_0009:  stloc.0
351         IL_000a:  ret
352     }
353
354         // Check that localloc cannot be inlined
355         .method static public int32 test_0_localloc_inline () cil managed {
356                 .maxstack 16
357                 .locals init (
358                         int32 i
359                 )
360
361                 ldc.i4.0
362         stloc.0
363         br COND
364
365 START:  call void class Tests::do_localloc()
366         ldloc.0
367         ldc.i4.1
368         add
369         stloc.0
370 COND:   ldloc.0
371         ldc.i4 1000
372         blt START
373
374                 ldc.i4.0
375                 ret
376         }       
377         
378         .method static public int32 test_3_copy_used_bug () il managed {
379
380                 .locals init (
381                         int32 size,
382                         int32 res
383                 )
384
385                 ldc.i4 0
386                 stloc res
387
388                 ldc.i4 1
389                 stloc size
390
391                 ldloc size
392                 ldloc size
393                 ldloc size
394                 add
395                 stloc size
396                 ldloc size
397                 add
398                 stloc res
399
400                 ldloc res
401                 ret
402         }
403
404         // demonstrate that the copy_used_var is not a fix for the above bug
405         .method static public int32 test_3_copy_used_indir_bug () il managed {
406
407                 .locals init (
408                         int32 size,
409                         int32 res
410                 )
411
412                 ldc.i4 0
413                 stloc res
414
415                 ldc.i4 1
416                 stloc size
417
418                 ldloc size
419                 ldloca size
420                 ldloc size
421                 ldloc size
422                 add
423                 stind.i4
424                 ldloc size
425                 add
426                 stloc res
427
428                 ldloc res
429                 ret
430         }
431
432         .method static public void do_nothing (int32 a) il managed {
433                 ret
434         }
435         
436         // demonstrate the block_split failure: needs -O=inline
437         // mini -O=inline --compile Tests:test_0_split_block_bug iltests.exe
438         .method static public int32 test_0_split_block_bug () il managed {
439
440                 .locals init (
441                         int32 i1
442                 )
443
444                 ldc.i4 1
445                 stloc i1
446  test_label:
447                 ldloc i1
448                 call void class Tests::do_nothing (int32)
449                 ldc.i4 0
450                 brtrue test_label
451                 
452                 ldc.i4 0
453                 ret
454         }
455
456         .method public void inline_do_nothing () il managed {
457                 ret
458         }
459         .method static public int32 test_1_checkthis_inlining () il managed {
460                 ldnull
461                 call instance void class Tests::inline_do_nothing ()
462                 ldc.i4 1
463                 ret
464         }
465
466         .class nested private auto ansi sealed beforefieldinit TailCallStruct 
467                 extends [mscorlib]System.ValueType {
468                 .field public int32 a
469                 .field public int32 b
470         }
471
472         .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
473                 ldarga 0
474                 ldarga 0
475                 ldfld int32 Tests/TailCallStruct::a
476                 ldc.i4.1
477                 add
478                 stfld int32 Tests/TailCallStruct::a
479                 ldarga 0
480                 ldarga 0
481                 ldfld int32 Tests/TailCallStruct::a
482                 ldc.i4.2
483                 add
484                 stfld int32 Tests/TailCallStruct::a
485                 ldarg.0
486                 ret
487         }
488
489         .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
490                 ldarg.0
491                 tail.
492                 call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
493                 ret
494         }
495
496         .class nested private auto ansi sealed beforefieldinit TailCallStructBig
497                 extends [mscorlib]System.ValueType {
498                 .field public int32 a
499                 .field public int32 b
500                 .field public int32 c
501                 .field public int32 d
502                 .field public int32 e
503         }
504
505         .method static valuetype Tests/TailCallStructBig tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig arg) {
506                 ldarga 0
507                 ldarga 0
508                 ldfld int32 Tests/TailCallStructBig::a
509                 ldc.i4.1
510                 add
511                 stfld int32 Tests/TailCallStructBig::a
512                 ldarg.0
513                 ret
514         }
515
516         .method static valuetype Tests/TailCallStructBig tail_vret_by_addr (valuetype Tests/TailCallStructBig arg) {
517                 ldarg.0
518                 tail.
519                 call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig)
520                 ret
521         }
522
523         .method static public int32 test_3_tail_call_vret_by_addr () il managed {
524                 .maxstack 16
525                 .locals init (
526                         valuetype Tests/TailCallStructBig arg2
527                 )
528
529                 ldloca 0
530                 ldc.i4.2
531                 stfld int32 Tests/TailCallStructBig::a
532                 ldloc.0
533                 call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr (valuetype Tests/TailCallStructBig)
534                 stloc.0
535
536                 ldloca 0
537                 ldfld int32 Tests/TailCallStructBig::a
538                 ret
539         }
540
541         .method static public int32 test_9_tail_call_vret_by_val () il managed {
542                 .maxstack 16
543                 .locals init (
544                         valuetype Tests/TailCallStruct arg
545                 )
546                 ldloca 0
547                 ldc.i4.2
548                 stfld int32 Tests/TailCallStruct::a
549                 ldloca 0
550                 ldc.i4.4
551                 stfld int32 Tests/TailCallStruct::b
552                 ldloc.0
553                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
554                 stloc.0
555
556                 ldloca 0
557                 ldfld int32 Tests/TailCallStruct::a
558                 ldloca 0
559                 ldfld int32 Tests/TailCallStruct::b
560                 add
561                 ret
562         }
563
564         .method static public int32 tail3 (int32 i, int32 j) il managed {
565                 ldarg.0
566                 ldarg.1
567                 add
568                 ret
569         }
570
571         .method static public int32 tail4 (int32 i, int32 j) il managed {
572                 .maxstack 16
573                 .locals init (
574                         int32 k)
575
576                 // Test arg0 allocated to a register
577                 ldarg.0
578                 ldarg.0
579                 ldarg.0
580                 ldarg.0
581                 add
582                 add
583                 add
584                 starg 0
585
586                 // Test switched up argument variables as the actual arguments
587                 ldarg.1
588                 ldarg.0
589                 tail.
590                 call int32 Tests::tail3 (int32, int32)
591                 ret
592         }
593
594         .method static public int32 test_24_tail_calls2 () il managed {
595                 // Some platforms might not be able to AOT tail calls
596                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
597
598                 .maxstack 16
599                 .locals init (
600                         int32 i,
601                         int32 j)
602
603                 ldc.i4.4
604                 stloc.0
605                 ldc.i4.8
606                 stloc.1
607
608                 ldloc.0 
609                 ldloc.1
610                 call int32 Tests::tail4 (int32, int32)
611                 ret
612         }
613
614         .method public static int32 test_5_jmp () cil managed {
615                 // Some platforms might not be able to AOT tail calls
616                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
617
618                 ldc.i4.1
619                 ldc.i4.2
620                 call int32 Tests::jmp2 (int32, int32)
621                 ret
622         }
623
624         .method public static int32 jmp2 (int32, int32) cil managed {
625                 ldarg.0
626                 ldc.i4.1
627                 add
628                 starg.s 0
629                 ldarg.1
630                 ldc.i4.1
631                 add
632                 starg.s 1
633                 jmp int32 Tests::jmp3 (int32, int32)
634                 ldc.i4.0
635                 ret
636         }               
637
638         .method public static int32 jmp3 (int32 i, int32 j) cil managed {
639                 ldarg.0
640                 ldarg.1
641                 add
642                 ret
643         }
644
645         .method static public int32 test_11_switch_with_nonempty_stack () il managed {
646                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
647                 .maxstack 16
648
649                 ldc.i4.5
650                 ldc.i4.6
651                 ldc.i4.1
652                 switch (L0, L1)
653         L0: 
654                 add
655                 ret
656         L1:
657                 add
658                 ret
659         }
660  
661     .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
662                 .maxstack 16
663
664         .try {
665           leave IL_0
666         }
667         finally  {
668           ldc.i4.0
669           endfinally
670         }
671         IL_0:  ldc.i4.5
672                 ret
673     }
674
675     .method public static int32 test_5_endfinally_llvm_linking () il managed {
676                 .maxstack 16
677
678         .try {
679           leave IL_0
680         }
681         finally  {
682           ldc.i4.0
683                   dup
684                   brtrue L1
685                   pop
686                   br L2
687                 L1:
688                   pop
689                 L2:
690           endfinally
691         }
692         IL_0:  ldc.i4.5
693                 ret
694     }
695
696         .method public static int32 test_0_conv_ovf_i8_neg () il managed {
697                 .maxstack 16
698
699                 ldc.i4.m1
700                 conv.ovf.i8
701                 conv.i4
702                 ldc.i4.m1
703                 beq L_OK
704                 ldc.i4.1
705                 ret
706         L_OK:
707                 ldc.i4.0
708                 ret
709         }               
710
711         .method public static int32 test_1234_conv_u4 () cil managed {
712                 .maxstack 16
713
714                 ldc.i4 1234
715                 conv.u4
716                 conv.i4
717                 ret
718         }
719
720         .method public static int32 test_0_conv_ovf_i_un () cil managed {
721                 .maxstack 16
722
723                 ldc.i4 1234
724                 conv.ovf.i.un
725                 conv.i4
726                 ldc.i4 1234
727                 beq L1
728                 ldc.i4.1
729                 ret
730         L1:
731                 ldc.i4 0x7fffffff
732                 conv.ovf.i.un
733                 conv.i4
734                 ldc.i4 0x7fffffff
735                 beq L2
736                 ldc.i4.2
737                 ret
738         L2:
739                 sizeof [mscorlib]System.IntPtr
740                 ldc.i4 8
741                 beq L5
742                 .try {
743                         ldc.i4 0x80000000
744                         conv.ovf.i.un
745                         leave L4
746                 } catch [mscorlib]System.OverflowException {
747                         pop
748                         leave L5
749                 }
750         L4: 
751                 ldc.i4.3
752                 ret
753         L5:
754                 ldc.i4.0
755                 ret
756         }
757
758         .method public static int32 test_0_conv_ovf_u_un () cil managed {
759                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
760                 .maxstack 16
761
762                 ldc.i4 1234
763                 conv.ovf.u.un
764                 conv.i4
765                 ldc.i4 1234
766                 beq L1
767                 ldc.i4.1
768                 ret
769         L1:
770                 ldc.i4.0
771                 ret
772         }
773
774         .method public static int32 test_0_conv_ovf_i () cil managed {
775                 .maxstack 16
776
777                 ldc.i4 1234
778                 conv.ovf.i
779                 conv.i4
780                 ldc.i4 1234
781                 beq L1
782                 ldc.i4.1
783                 ret
784         L1:
785                 ldc.i4.0
786                 ret
787         }
788
789         .method public static int32 test_0_conv_ovf_u () cil managed {
790                 .maxstack 16
791
792                 ldc.i4 1234
793                 conv.ovf.u
794                 conv.i4
795                 ldc.i4 1234
796                 beq L1
797                 ldc.i4.1
798                 ret
799         L1:
800                 ldc.i4.0
801                 ret
802         }
803
804         .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
805                 .maxstack 16
806
807                 ldc.i4 1234
808                 conv.ovf.i8.un
809                 conv.i4
810                 ret
811         }
812
813         .method public static int32 test_0_lconv_ovf_i () cil managed {
814                 .maxstack 16
815
816                 ldc.i4 1234
817                 conv.i8
818                 conv.ovf.i
819                 conv.i4
820                 ldc.i4 1234
821                 beq L1
822                 ldc.i4.1
823                 ret
824         L1:
825                 ldc.i4.0
826                 ret
827         }
828
829         .method public static int32 test_0_lconv_ovf_u () cil managed {
830                 .maxstack 16
831
832                 ldc.i4 1234
833                 conv.i8
834                 conv.ovf.u
835                 conv.i4
836                 ldc.i4 1234
837                 beq L1
838                 ldc.i4.1
839                 ret
840         L1:
841                 ldc.i4.0
842                 ret
843         }
844
845         .method public static int32 test_0_lconv_ovf_i_un () cil managed {
846                 .maxstack 16
847
848                 ldc.i4 1234
849                 conv.i8
850                 conv.ovf.i.un
851                 conv.i4
852                 ldc.i4 1234
853                 beq L1
854                 ldc.i4.1
855                 ret
856         L1:
857                 ldc.i4.0
858                 ret
859         }
860
861         .method public static int32 test_0_lconv_ovf_u_un () cil managed {
862                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
863                 .maxstack 16
864
865                 ldc.i4 1234
866                 conv.i8
867                 conv.ovf.u.un
868                 conv.i4
869                 ldc.i4 1234
870                 beq L1
871                 ldc.i4.1
872                 ret
873         L1:
874                 ldc.i4.0
875                 ret
876         }
877
878         .method public static int32 test_0_lconv_to_ovf_i8 () cil managed {
879                 .maxstack 16
880
881                 ldc.i4 1234
882                 conv.i8
883                 conv.ovf.i8
884                 conv.i4
885                 ldc.i4 1234
886                 beq L1
887                 ldc.i4.1
888                 ret
889         L1:
890                 ldc.i4.0
891                 ret
892         }
893
894         .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
895                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
896                 .maxstack 16
897
898                 ldc.i4 1234
899                 conv.i8
900                 conv.ovf.u8.un
901                 conv.i4
902                 ldc.i4 1234
903                 beq L1
904                 ldc.i4.1
905                 ret
906         L1:
907                 ldc.i4.0
908                 ret
909         }
910
911         .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
912                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
913                 .maxstack 16
914                 .locals init (int32 res)
915
916                 ldc.i4 0x7fffffff
917                 conv.u8
918                 conv.ovf.i4.un
919                 pop
920
921                 ldc.i4.2
922                 stloc res
923
924         .try {
925                         ldc.i8 0x80000000
926                         conv.ovf.i4.un
927                         pop
928                         ldc.i4.0
929                         stloc res
930                         leave RET
931                 } catch [mscorlib]System.OverflowException {
932                         pop
933                         leave IL_0
934                 }
935
936         IL_0:
937
938         .try {
939                         ldc.i8 0xffffffff80000000
940                         conv.ovf.i4.un
941                         pop
942                         ldc.i4.1
943                         stloc res
944                         leave RET
945                 } catch [mscorlib]System.OverflowException {
946                         pop
947                         leave RET
948                 }
949
950         RET:
951                 ldloc res
952                 ret
953         }
954
955     .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
956                 .maxstack 16
957                 .locals init (int32 res)
958
959                 ldc.i4 0x7fffffff
960                 conv.u8
961                 conv.ovf.i.un
962                 conv.i4
963                 pop
964
965                 ldc.i4.1
966                 ret
967         }
968
969         .method public static int32 test_32_lconv_to_u8 () cil managed
970         {
971                 .maxstack 16
972
973                 ldc.i4 32
974                 conv.i8
975                 conv.u8
976                 conv.i4
977                 ret
978         }                               
979
980         .method public static int32 test_32_lconv_to_i8 () cil managed
981         {
982                 .maxstack 16
983
984                 ldc.i4 32
985                 conv.i8
986                 conv.i8
987                 conv.i4
988                 ret
989         }                               
990
991         .method public static int32 test_15_lconv_to_u () cil managed
992         {
993         ldc.i8 0x10000000f
994                 conv.u
995                 conv.i4
996                 ret
997         }
998
999         .method public static int32 test_1234_fconv_u () cil managed {
1000                 .maxstack 16
1001
1002                 ldc.r8 1234.0
1003                 conv.u
1004                 conv.i4
1005                 ret
1006         }
1007
1008         .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
1009         {
1010                 .maxstack 16
1011         
1012                 ldc.i4.1
1013                 brfalse OBJECT
1014         
1015                 ldtoken [mscorlib]System.String
1016                 br AFTER
1017         OBJECT:
1018                 ldtoken [mscorlib]System.Object
1019         AFTER:
1020                 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
1021                 callvirt instance string class [mscorlib]System.Type::get_FullName ()
1022                 ldstr "System.String"
1023                 callvirt instance bool class [mscorlib]System.Object::Equals(object)
1024                 ldc.i4.0
1025                 ceq
1026                 ret 
1027         }
1028                 
1029         .method public static int32 test_0_bug59580  ()
1030         {
1031                 ldc.r4          float32(0x7FC00000)
1032                 ldc.r4          float32(0x7FC00000)
1033                 bge.un          pass
1034                 br              fail
1035         pass:
1036                 ldc.i4.0
1037                 ret
1038         fail:
1039                 ldc.i4.1
1040                 ret
1041         }
1042         
1043         .method public static int32 test_1_bug60056  () {
1044                 .locals init (int32 m5)
1045                         
1046                 ldc.i4.m1
1047                 stloc.0
1048                 
1049                 ldc.i4.1
1050                 conv.u8
1051                 
1052                 ldloc.0
1053                 conv.i8
1054                 mul
1055                 
1056                 ldc.i4.m1
1057                 conv.i8
1058                 ceq
1059                 ret
1060         }
1061         
1062         .method public static int32 test_1_conv_u8_cfold  () {
1063                 ldc.i4.m1
1064                 conv.u8
1065                 
1066                 ldc.i8 0x00000000ffffffff
1067                 
1068                 ceq
1069                 ret
1070         }
1071         
1072         .method public static int32 test_1_array_type_mismatch_ldelema  () {
1073                 .locals init (int32 r)
1074                 
1075                         ldc.i4.1
1076                         newarr string
1077                         ldc.i4.0 
1078                         ldelema string
1079                         pop
1080                 
1081                 .try {
1082                         ldc.i4.1
1083                         newarr string
1084                         ldc.i4.0 
1085                         ldelema object
1086                         pop
1087                         
1088                         leave end
1089                 } catch [mscorlib]System.ArrayTypeMismatchException {
1090                         pop
1091                         ldc.i4.1
1092                         stloc.0
1093                         leave end
1094                 }
1095         end:
1096                 ldloc.0
1097                 ret
1098         }
1099
1100         .method public static int32 test_1_conv_ovf_i8_with_i4 () {
1101                         ldc.i4.m1 
1102                         conv.ovf.i8
1103                         conv.ovf.i4
1104                         neg
1105                         ret
1106         }
1107
1108         // bug #72148
1109     .method public static int32 test_0_initlocals_float_ptr () {
1110         .maxstack 3
1111         .locals init (
1112                 float32[]       V_0,
1113                 float32& pinned V_1,
1114                 unsigned int32  V_2)
1115                         ldc.i4.s 0x0f
1116                         newarr [mscorlib]System.Single
1117                         stloc.0 
1118                         ldloc.0 
1119                         ldc.i4.0 
1120                         ldc.r4 1.13
1121                         stelem.r4 
1122                         ldloc.0 
1123                         ldc.i4.0 
1124                         ldelema [mscorlib]System.Single
1125                         stloc.1 
1126                         ldloc.1 
1127                         conv.i 
1128                         ldind.u4 
1129                         stloc.2 
1130                         ldc.i4.0
1131                         ret
1132         }
1133
1134         .method public static int32 test_7_conv_ovf_u8_un () {
1135                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1136         .maxstack  2
1137         .locals    init (unsigned int64)
1138
1139         ldc.i4.7
1140         conv.ovf.u8.un
1141         stloc.0
1142                 ldloc.0
1143                 conv.i4
1144         ret
1145         }
1146
1147         .method public static int32 test_7_conv_ovf_u4_un () {
1148         .maxstack  2
1149         .locals    init (unsigned int32)
1150
1151         ldc.i4.7
1152         conv.ovf.u4.un
1153         stloc.0
1154                 ldloc.0
1155                 conv.i4
1156         ret
1157         }
1158
1159         .method public static int32 test_1_bug_74591 () {
1160                 .maxstack 16
1161                 .locals init (int32)
1162
1163                 ldc.i4.m1
1164                 stloc.0
1165                 ldloc.0
1166                 conv.ovf.i8
1167                 ldc.i4.m1
1168                 conv.ovf.i8
1169                 mul.ovf
1170                 conv.i4
1171                 ret
1172         }
1173
1174         .class nested public auto ansi Integer
1175                 extends [mscorlib]System.Object {
1176
1177                 .field public bool n
1178
1179             .method public hidebysig  specialname  rtspecialname 
1180            instance default void .ctor (unsigned int64 i, bool n)  cil managed 
1181             {
1182                         .maxstack 8
1183                         ldarg.0
1184                         call instance void class [mscorlib]System.Object::.ctor()
1185                         ldarg.0
1186                         ldarg.2
1187                         stfld bool Tests/Integer::n
1188                         ret
1189                 }
1190         }
1191
1192         .method public static int32 test_1_bug_74726 () {
1193                 .maxstack 16
1194
1195                 ldc.i4.2
1196                 conv.ovf.u8
1197                 ldc.i4.1
1198                 conv.ovf.u8
1199                 mul.ovf.un
1200                 ldc.i4.1
1201                 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
1202                 ldfld bool Tests/Integer::n
1203                 ldc.i4.1
1204                 ceq
1205                 ret
1206         }
1207
1208         .class nested private auto ansi sealed xxx
1209         extends [mscorlib]System.ValueType
1210    {
1211      .field  public   object a
1212
1213      .method public hidebysig  specialname  rtspecialname 
1214             instance default void .ctor ()  cil managed 
1215      {
1216                  .maxstack 8
1217                  ret 
1218      }
1219    } // end of class xxx
1220
1221         .method public static int32 test_0_newobj_vtype () {
1222                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1223                 .maxstack 6
1224                 .locals init (
1225                         valuetype Tests/xxx V_0
1226                 )
1227
1228                 newobj instance void valuetype Tests/xxx::.ctor ()
1229                 stloc.0
1230                 ldloca.s 0
1231                 ldfld object Tests/xxx::a
1232                 brfalse OK
1233                 ldc.i4.s 1
1234                 ret
1235         OK:
1236                 ldc.i4.s 0
1237                 ret
1238         }
1239
1240         .method public static int32 test_0_newobj_vtype_primitive () {
1241                 .maxstack 6
1242                 .locals init (
1243                         native int V_0
1244                 )
1245
1246                 ldc.i4.s 10
1247                 newobj instance void native int::'.ctor'(int32)
1248                 stloc.0
1249                 ldloc.0
1250                 ldc.i4.s 10
1251                 beq OK
1252                 ldc.i4.s 1
1253                 ret
1254         OK:
1255                 ldc.i4.s 0
1256                 ret
1257         }
1258
1259         .method public static int32 test_1_filters () {
1260                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1261                 // .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 08 21 42 49 54 43 4F 44 45 00 00 )          // ...!BITCODE..
1262                 .maxstack 16
1263                 .locals init (
1264                         int32 res
1265                 )
1266
1267                 .try { // 0
1268                         .try {
1269                                 ldstr "OnErrorSub test Exception"
1270                                 newobj instance void class [mscorlib]System.Exception::.ctor(string)
1271                                 throw 
1272                                 leave.s IL_0033
1273                         }
1274                         filter {
1275                                 pop
1276                                 ldc.i4.0
1277                                 endfilter
1278                         } {
1279                                 pop
1280                                 // Should not be called
1281                                 ldc.i4.2
1282                                 stloc res
1283                                 leave.s IL_0033
1284                         }
1285                 }
1286                 filter {
1287                         pop
1288                         ldc.i4.1
1289                         endfilter 
1290                 } {
1291                   pop
1292                   ldc.i4.1
1293                   stloc res       
1294                   leave.s IL_0033
1295
1296                 }
1297                 IL_0033:
1298                 ldloc res
1299                 ret
1300         }
1301
1302         .class nested private auto ansi sealed beforefieldinit TheStruct
1303                 extends [mscorlib]System.ValueType {
1304                 .field public int32 a
1305                 .field public int32 b
1306         }
1307
1308         .method public static int32 test_5_cpobj () {
1309                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1310                 .maxstack 8
1311                 .locals init (  
1312                                 valuetype Tests/TheStruct v_0, 
1313                                 valuetype Tests/TheStruct v_1
1314                                          )
1315
1316                 ldloca v_0
1317                 ldc.i4.2
1318                 stfld int32 Tests/TheStruct::a
1319
1320                 ldloca v_0
1321                 ldc.i4.3
1322                 stfld int32 Tests/TheStruct::b
1323
1324                 ldloca v_1
1325                 ldloca v_0
1326                 cpobj Tests/TheStruct
1327
1328                 ldloca v_1
1329                 ldfld int32 Tests/TheStruct::a
1330                 ldloca v_1
1331                 ldfld int32 Tests/TheStruct::b
1332                 add
1333
1334                 ret
1335         }
1336
1337         .method public static int32 test_5_ldobj_stloc_optimization () {
1338                 .maxstack 8
1339                 .locals init (  
1340                                 valuetype Tests/TheStruct v_0, 
1341                                 valuetype Tests/TheStruct v_1
1342                                          )
1343
1344                 ldloca v_0
1345                 ldc.i4.2
1346                 stfld int32 Tests/TheStruct::a
1347
1348                 ldloca v_0
1349                 ldc.i4.3
1350                 stfld int32 Tests/TheStruct::b
1351
1352                 ldloca v_0
1353                 ldobj valuetype Tests/TheStruct
1354                 stloc.s v_1
1355
1356                 ldloca v_1
1357                 ldfld int32 Tests/TheStruct::a
1358                 ldloca v_1
1359                 ldfld int32 Tests/TheStruct::b
1360                 add
1361
1362                 ret
1363         }
1364
1365         .method public static int32 test_1_cpobj_reference () {
1366                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1367                 .maxstack 8
1368                 .locals init (  
1369                                 object v_0, 
1370                                 object v_1
1371                                          )
1372
1373                 newobj instance void object::.ctor()
1374                 stloc v_0
1375
1376                 ldloca v_1
1377                 ldloca v_0
1378                 cpobj object
1379
1380                 ldloc v_0
1381                 ldloc v_1
1382                 ceq
1383                 ret
1384         }
1385
1386         .method public static int32 test_1_initobj_reference () {
1387                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1388                 .maxstack 8
1389                 .locals init (  
1390                                 object v_0
1391                                          )
1392
1393                 newobj instance void object::.ctor()
1394                 stloc v_0
1395
1396                 ldloca v_0
1397                 initobj object
1398
1399                 ldloc v_0
1400                 ldnull
1401                 ceq
1402                 ret
1403         }
1404
1405         .method public static int32 test_1_ldobj_reference () {
1406                 .maxstack 8
1407                 .locals init (  
1408                                 object v_0
1409                                          )
1410
1411                 newobj instance void object::.ctor()
1412                 stloc v_0
1413
1414                 ldloc v_0
1415                 ldloca v_0
1416                 ldobj object
1417                 ceq
1418                 ret
1419         }
1420
1421         .method public static int32 test_5_vtype_on_bb_boundary () {
1422                 .maxstack 8
1423                 .locals init (  
1424                                 valuetype Tests/TheStruct v_0, 
1425                                 valuetype Tests/TheStruct v_1
1426                                          )
1427
1428                 ldloca v_0
1429                 ldc.i4.2
1430                 stfld int32 Tests/TheStruct::a
1431
1432                 ldloca v_0
1433                 ldc.i4.3
1434                 stfld int32 Tests/TheStruct::b
1435
1436                 ldloc v_0
1437                 br L_0
1438         L_0: stloc v_1
1439
1440                 ldloca v_1
1441                 ldfld int32 Tests/TheStruct::a
1442                 ldloca v_1
1443                 ldfld int32 Tests/TheStruct::b
1444                 add
1445                 ret
1446         }
1447
1448         .method public static int32 test_5_different_in_stacks () cil managed {
1449                 .maxstack 16
1450
1451                         ldc.i4.1
1452                         ldc.i4.1
1453                         beq L_0
1454
1455                         ldc.i4.3
1456                         ldc.i4.3
1457                         br L_1
1458                         ldc.i4.3
1459                         ldc.i4.3
1460                         br L_2
1461          L_0:   ldc.i4.2
1462                         ldc.i4.3
1463                         ldc.i4.1
1464                         ldc.i4.1
1465                         beq L_2
1466          L_1:   add
1467                         ret
1468          L_2:   add
1469                         ret
1470         }
1471
1472         .method public static int32 test_3_larray_get_set () {
1473                 .locals init (
1474                         int32[2]        V_0)
1475                           
1476                         ldc.i4.2 
1477                         newobj instance void int32[0...]::.ctor(int32)
1478                         stloc.0 
1479                         ldloc.0 
1480                         ldc.i4.0 
1481                         ldc.i4 1
1482                         call instance void int32[0...]::Set(int32, int32)
1483                     ldloc.0 
1484                     ldc.i4.1 
1485                         ldc.i4 2
1486                         call instance void int32[0...]::Set(int32, int32)
1487
1488                         ldloc.0
1489                         ldc.i4.0
1490                         call instance int32 int32[0...]::Get(int32)
1491                         ldloc.0
1492                         ldc.i4.1
1493                         call instance int32 int32[0...]::Get(int32)
1494                         add
1495                         ret
1496         }
1497
1498         .method public static int32 test_0_pop_side_effects () {
1499                 .try {
1500                         ldc.r8 1
1501                         ldc.r8 0
1502                         div
1503                         ckfinite
1504                         pop
1505                         leave FAIL
1506                 }
1507                 catch [mscorlib]System.ArithmeticException {
1508                         pop
1509                         leave L_0
1510                 }
1511                 L_0:
1512                 ldc.i4.0
1513                 ret
1514                 FAIL:
1515                 ldc.i4.1
1516                 ret
1517         }
1518
1519         .method public static void regalloc_regress_78314_helper (object o) cil managed
1520         {
1521                 ret
1522         }
1523
1524         .method public static int32 test_1_regalloc_regress_78314 () cil managed
1525         {
1526     // Code size       68 (0x44)
1527     .maxstack  6
1528     .locals init (int32 V_0, bool V_1)
1529     IL_0000:  ldc.i4.0
1530     IL_0001:  stloc.0
1531     IL_0002:  br.s       IL_003b
1532
1533     IL_0004:
1534     IL_001e:  ldc.i4.s   10
1535     IL_0020:  ldloc.0
1536     IL_0021:  shl
1537     IL_0022:  ldc.i4.s   10
1538     IL_0024:  ldloc.0
1539     IL_0025:  shl
1540     IL_0026:  ceq
1541     IL_0028:  box        [mscorlib]System.Boolean
1542     IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
1543     IL_0037:  ldloc.0
1544     IL_0038:  ldc.i4.1
1545     IL_0039:  add
1546     IL_003a:  stloc.0
1547     IL_003b:  ldloc.0
1548     IL_003c:  ldc.i4.8
1549     IL_003f:  blt.s      IL_0004
1550
1551         ldloc.0
1552         ldc.i4.8
1553         ceq
1554         conv.i4
1555         ret     
1556   }
1557
1558         .method public static void try_block_end_remove_if_useless () cil managed {
1559             .maxstack  8
1560
1561             T_START:
1562                 ldstr   "Start"
1563                         pop
1564                 leave.s COMPLETE
1565             T1_END:
1566
1567             COMPLETE:
1568                 ret
1569
1570             F1_START:
1571                 ldstr   "Finally1"
1572                         pop
1573                 endfinally
1574             F1_END:
1575
1576             .try T_START to T1_END finally handler F1_START to F1_END
1577         }
1578
1579         .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1580                 call void class Tests::try_block_end_remove_if_useless ()
1581                 ldc.i4.0
1582                 ret
1583         }
1584
1585    .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
1586     {
1587         ldc.i4.0
1588         switch (target)
1589         target: ldstr "bar"
1590                 pop
1591                 ldc.i4.0
1592         ret
1593     }
1594
1595         // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1596         // generate the non .un version of the opcodes
1597     .method private static  hidebysig 
1598            default int32 test_4_float_branch_nan ()  cil managed 
1599     {
1600         // Method begins at RVA 0x27a4
1601         // Code size 74 (0x4a)
1602         .maxstack 2
1603         .locals init (
1604                 float64 V_0,
1605                 float64 V_1,
1606                 int32   V_2)
1607         IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
1608         IL_0009:  stloc.0 
1609         IL_000a:  ldc.r8 1.
1610         IL_0013:  stloc.1 
1611         IL_0014:  ldc.i4.0 
1612         IL_0015:  stloc.2 
1613         IL_0016:  ldloc.0 
1614         IL_0017:  ldloc.1 
1615         IL_0018:  bge.s IL_001a
1616
1617                                 br L1
1618         IL_001a:  ldloc.2 
1619         IL_001b:  ret 
1620         L1:
1621         IL_001c:  ldloc.2 
1622         IL_001d:  ldc.i4.1 
1623         IL_001e:  add 
1624         IL_001f:  stloc.2 
1625         IL_0020:  ldloc.0 
1626         IL_0021:  ldloc.1 
1627         IL_0022:  ble.s IL_002e
1628                                 br L2
1629         IL_002e:  ldloc.2 
1630         IL_002f:  ret 
1631         L2:
1632         IL_0030:  ldloc.2 
1633         IL_0031:  ldc.i4.1 
1634         IL_0032:  add 
1635         IL_0033:  stloc.2 
1636         IL_0034:  ldloc.0 
1637         IL_0035:  ldloc.1 
1638         IL_0036:  blt.s IL_0038
1639                                 br L3           
1640         IL_0038:  ldloc.2 
1641         IL_0039:  ret 
1642         L3:
1643         IL_003a:  ldloc.2 
1644         IL_003b:  ldc.i4.1 
1645         IL_003c:  add 
1646         IL_003d:  stloc.2 
1647         IL_003e:  ldloc.0 
1648         IL_003f:  ldloc.1 
1649         IL_0040:  bgt.s IL_0042
1650                                 br L4
1651         IL_0042:  ldloc.2 
1652         IL_0043:  ret 
1653         L4:
1654         IL_0044:  ldloc.2 
1655         IL_0045:  ldc.i4.1 
1656         IL_0046:  add 
1657         IL_0047:  stloc.2 
1658         IL_0048:  ldloc.2 
1659         IL_0049:  ret 
1660     } // end of method Tests::test_5_float_branch_nan
1661
1662     .method private static  hidebysig
1663            default void regress_80622_inner (object x)  cil managed
1664     {
1665                 .locals init (unsigned int8 i)
1666         // Method begins at RVA 0x2050
1667         // Code size 14 (0xe)
1668         .maxstack 8
1669         IL_1000:  ldarg.0
1670         IL_1001:  unbox unsigned int8
1671         IL_1006:  ldobj unsigned int8
1672         IL_000b:  conv.ovf.i4.un
1673         IL_000c:  pop
1674         IL_000d:  ret
1675     }
1676
1677     // method line 2
1678     .method private static  hidebysig
1679            default int32 test_0_regress_80622 ()  cil managed
1680     {
1681         .maxstack 8
1682         IL_0000:  ldc.i4 255
1683         IL_0005:  box unsigned int8
1684         IL_000a:  call void class Tests::regress_80622_inner (object)
1685                 ldc.i4.0
1686         IL_000f:  ret
1687     }
1688
1689         .method private static default int32 test_0_regresss_80190 () cil managed
1690         {
1691             .maxstack  2
1692             .locals init (int32 V_0,
1693                      int32* V_1)
1694             IL_0000:  nop
1695             IL_0001:  nop
1696             IL_0002:  ldloca.s   V_0
1697             IL_0004:  conv.u
1698             IL_0005:  stloc.1
1699             IL_0006:  ldloc.1
1700             IL_0007:  ldc.i4.3
1701             IL_0008:  stind.i4
1702             IL_0009:  nop
1703                                   ldc.i4.0
1704                                   ret
1705         }
1706
1707         .class interface nested public auto ansi abstract IFaceWithStaticMethod
1708         {
1709             .method public static  specialname 
1710                default void foo ()  cil managed noinlining 
1711             {
1712                 .maxstack 0
1713                 IL_0000:  ret 
1714         }
1715         }
1716         
1717         .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1718         {
1719             .method public hidebysig  specialname  rtspecialname 
1720            instance default void .ctor ()  cil managed 
1721             {
1722                         .maxstack 8
1723                         ret
1724                 }
1725
1726         }
1727
1728         // Test that static methods in interfaces are ignored during vtable construction
1729         .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1730         {
1731                 .maxstack 16
1732
1733                 newobj instance void class Tests/AClass::.ctor()
1734                 pop
1735                 ldc.i4.0
1736                 ret
1737         }
1738
1739         .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
1740                 ldarg.0
1741                 box !!0
1742                 brtrue HAS_VALUE
1743                 ldc.i4.0
1744                 ret
1745 HAS_VALUE:      ldc.i4.1
1746                 ret
1747         }
1748
1749         // bug 78019
1750         .method static public int32 test_0_nullable_box_brtrue () cil managed {
1751
1752                 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1753
1754                 ldloc.0
1755                 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1756                 ret
1757         }
1758
1759         //Bug 372410
1760         .method static public int32 test_0_ldelema_type_check () cil managed {
1761                 .maxstack 16
1762                 .locals init (object[] V_0,
1763                                           object[,] V_1)
1764
1765                 ldc.i4.1
1766                 newarr object
1767                 stloc.0
1768
1769                 .try {
1770                         ldloc.0
1771                         ldc.i4.0
1772                         ldelema object
1773                         leave L1
1774                 } catch [mscorlib]System.ArrayTypeMismatchException {
1775                         leave ERROR1
1776                 }
1777
1778         L1:
1779                 ldc.i4.1
1780                 newarr string
1781                 stloc.0
1782
1783                 .try {
1784                         ldloc.0
1785                         ldc.i4.0
1786                         ldelema object
1787                         leave ERROR2
1788                 } catch [mscorlib]System.ArrayTypeMismatchException {
1789                         leave L2
1790                 }
1791
1792         L2:
1793                         ldc.i4.1
1794                 newarr string
1795                 stloc.0
1796
1797                 .try {
1798                         ldloc.0
1799                         ldc.i4.0
1800                         readonly. ldelema object
1801                         leave L3
1802                 } catch [mscorlib]System.ArrayTypeMismatchException {
1803                         leave ERROR3
1804                 }
1805
1806         L3:
1807                 ldc.i4.0
1808                 ret
1809
1810
1811         ERROR1:
1812                 ldc.i4.1
1813                 ret
1814
1815         ERROR2:
1816                 ldc.i4.2
1817                 ret
1818
1819         ERROR3:
1820                 ldc.i4.3
1821                 ret
1822         }
1823
1824
1825         //Bug 372410
1826         .method static public int32 test_0_array_address_type_check () cil managed {
1827                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
1828                 .maxstack 16
1829                 .locals init (object[] V_0,
1830                                           object[,] V_1)
1831
1832                 ldc.i4.1 
1833             ldc.i4.1 
1834             newobj instance void object[,]::.ctor(int32, int32)
1835                 stloc.1
1836
1837                 .try {
1838                         ldloc.1
1839                         ldc.i4.0
1840                         ldc.i4.0
1841                         call instance object&  object[,]::Address(int32, int32)
1842                         leave L4
1843                 } catch [mscorlib]System.ArrayTypeMismatchException {
1844                         leave ERROR4
1845                 }
1846
1847         L4:
1848                 ldc.i4.1 
1849             ldc.i4.1 
1850             newobj instance void string[,]::.ctor(int32, int32)
1851                 stloc.1
1852
1853                 .try {
1854                         ldloc.1
1855                         ldc.i4.0
1856                         ldc.i4.0
1857                         call instance object&  object[,]::Address(int32, int32)
1858                         leave ERROR5
1859                 } catch [mscorlib]System.ArrayTypeMismatchException {
1860                         leave L5
1861                 }
1862
1863         L5:
1864                 ldc.i4.1 
1865             ldc.i4.1 
1866             newobj instance void string[,]::.ctor(int32, int32)
1867                 stloc.1
1868
1869                 .try {
1870                         ldloc.1
1871                         ldc.i4.0
1872                         ldc.i4.0
1873                         readonly. call instance object&  object[,]::Address(int32, int32)
1874                         leave L6
1875                 } catch [mscorlib]System.ArrayTypeMismatchException {
1876                         leave ERROR6
1877                 }
1878
1879         L6:
1880                 ldc.i4.0
1881                 ret
1882         ERROR4:
1883                 ldc.i4.4
1884                 ret
1885
1886         ERROR5:
1887                 ldc.i4.5
1888                 ret
1889
1890         ERROR6:
1891                 ldc.i4.6
1892                 ret
1893         }
1894
1895         .field public  static unsigned int64 'ull'
1896
1897         .field public  static int32 'shift2'
1898
1899         .method public static int32 test_0_long_shift_regalloc () cil managed
1900         {
1901                 .locals init (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
1902
1903                 .maxstack 4
1904
1905                 ldc.i8  81985529234382576
1906                 stsfld  unsigned int64 Tests::ull
1907             ldc.i4      60
1908                 stsfld  int32 Tests::shift2
1909
1910                 ldsfld  unsigned int64 Tests::ull
1911                 stloc   'cilsimp.27'
1912                 ldsfld  int32 Tests::shift2
1913                 stloc   'cilsimp.28'
1914                 ldloc   'cilsimp.27'
1915                 ldloc   'cilsimp.28'
1916                 shr.un
1917                 ldloc   'cilsimp.27'
1918                 ldc.i4  64
1919                 ldloc   'cilsimp.28'
1920                 sub
1921                 shl
1922                 or
1923                 ldc.i8  1311768467750121216
1924                 ceq
1925                 ldc.i4.1
1926                 xor
1927                 conv.u4
1928                 ret
1929         }
1930
1931         // Test calling ldfld directly on a vtype instead of a vtype address
1932         .method public static int32 test_5_call_ldfld_vtype () cil managed
1933         {
1934                 .maxstack 16
1935                 .locals init (
1936                         valuetype Tests/TailCallStruct arg
1937                 )
1938                 ldloca 0
1939                 ldc.i4.2
1940                 stfld int32 Tests/TailCallStruct::a
1941                 ldloca 0
1942                 ldc.i4.4
1943                 stfld int32 Tests/TailCallStruct::b
1944                 ldloc.0
1945                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
1946                 ldfld int32 Tests/TailCallStruct::a
1947                 ret
1948         }
1949
1950         .method public static int32 throw_ret () cil managed
1951         {
1952                 ldstr "FOO"
1953                 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
1954                 throw
1955                 ldc.i4.4
1956                 ret
1957         }
1958
1959         .method public static int32 throw2_ret () cil managed
1960         {
1961                 // Disable inlining
1962                 ldc.i4.5
1963                 localloc
1964                 pop
1965
1966                 call int32 Tests::throw_ret ()
1967                 ret
1968         }
1969
1970         // Test inlining a method which contains just a throw
1971         .method public static int32 test_0_inline_throw () cil managed
1972         {
1973                 .maxstack 16
1974                 .locals init (
1975                                 int32 v_0
1976                 )
1977
1978                 .try {
1979                         call int32 Tests::throw2_ret ()
1980                         stloc.0
1981                         leave L0
1982                 } catch [mscorlib]System.OverflowException {
1983                         pop
1984                         leave L1
1985                 }
1986
1987                 L0:
1988                         ldc.i4.1
1989                         ret
1990                 L1:
1991                         ldc.i4.0
1992                         ret                     
1993         }
1994
1995     .method public static int32 test_0_stelem_any_null_opt () cil managed
1996     {
1997                 .maxstack 16
1998                 .locals init (
1999                                 object[]        V_0,
2000                                 int32   V_1)
2001
2002                 ldc.i4.s 10
2003                 newarr [mscorlib]System.Object
2004                 stloc.0
2005
2006                 ldc.i4.0
2007                 stloc.1
2008                 br L0
2009
2010         L1:
2011                 ldloc.0
2012                 ldloc.1
2013                 ldnull
2014                 stelem.any [mscorlib]System.Object
2015                 ldloc.1
2016                 ldc.i4.1
2017                 add
2018                 stloc.1
2019         L0:
2020                 ldloc.1
2021                 ldc.i4.s 10
2022                 blt L1
2023
2024                 ldc.i4.0
2025                 ret
2026         }
2027
2028     // method line 2
2029     .method public static  hidebysig 
2030            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 
2031     {
2032         // Method begins at RVA 0x20f4
2033         // Code size 44 (0x2c)
2034         .maxstack 8
2035         IL_0000:  ldarg.0 
2036         IL_0001:  ldarg.1 
2037         IL_0002:  add 
2038         IL_0003:  ldarg.2 
2039         IL_0004:  add 
2040         IL_0005:  ldarg.3 
2041         IL_0006:  add 
2042         IL_0007:  ldarg.s 4
2043         IL_0009:  add 
2044         IL_000a:  ldarg.s 5
2045         IL_000c:  add 
2046         IL_000d:  ldarg.s 6
2047         IL_000f:  add 
2048         IL_0010:  ldarg.s 7
2049         IL_0012:  add 
2050         IL_0013:  ldarg.s 8
2051         IL_0015:  add 
2052         IL_0016:  ldarg.s 9
2053         IL_0018:  add 
2054         IL_0019:  ldarg.s 10
2055         IL_001b:  add 
2056         IL_001c:  ldarg.s 11
2057         IL_001e:  add 
2058         IL_001f:  ldarg.s 12
2059         IL_0021:  add 
2060         IL_0022:  ldarg.s 13
2061         IL_0024:  add 
2062         IL_0025:  ldarg.s 14
2063         IL_0027:  add 
2064         IL_0028:  ldarg.s 15
2065         IL_002a:  add 
2066         IL_002b:  ret 
2067     } // end of method main::callee
2068
2069     // method line 3
2070     .method public static  hidebysig 
2071            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 
2072     {
2073         // Method begins at RVA 0x2124
2074         // Code size 34 (0x22)
2075         .maxstack 17
2076         IL_0000:  ldarg.0 
2077                           ldc.i4.1
2078                           add
2079         IL_0001:  ldarg.1 
2080         IL_0002:  ldarg.2 
2081         IL_0003:  ldarg.3 
2082         IL_0004:  ldarg.s 4
2083         IL_0006:  ldarg.s 5
2084         IL_0008:  ldarg.s 6
2085         IL_000a:  ldarg.s 7
2086         IL_000c:  ldarg.s 8
2087         IL_000e:  ldarg.s 9
2088         IL_0010:  ldarg.s 10
2089         IL_0012:  ldarg.s 11
2090         IL_0014:  ldarg.s 12
2091         IL_0016:  ldarg.s 13
2092         IL_0018:  ldarg.s 14
2093                           ldc.i4.1
2094                           add
2095         IL_001a:  ldarg.s 15
2096                           ldc.i4.1
2097                           add
2098                   tail.
2099         IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
2100         IL_0021:  ret 
2101     } // end of method main::caller
2102
2103     // method line 4
2104     .method public static  hidebysig 
2105            default int32 test_139_many_args_tail_call ()  cil managed
2106     {
2107                 // Some platforms might not be able to AOT tail calls
2108                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
2109
2110         // Method begins at RVA 0x2154
2111         // Code size 43 (0x2b)
2112         .maxstack 17
2113         IL_0000:  ldc.i4.1 
2114         IL_0001:  ldc.i4.2 
2115         IL_0002:  ldc.i4.3 
2116         IL_0003:  ldc.i4.4 
2117         IL_0004:  ldc.i4.5 
2118         IL_0005:  ldc.i4.6 
2119         IL_0006:  ldc.i4.7 
2120         IL_0007:  ldc.i4.8 
2121         IL_0008:  ldc.i4.s 0x09
2122         IL_000a:  ldc.i4.s 0x0a
2123         IL_000c:  ldc.i4.s 0x0b
2124         IL_000e:  ldc.i4.s 0x0c
2125         IL_0010:  ldc.i4.s 0x0d
2126         IL_0012:  ldc.i4.s 0x0e
2127         IL_0014:  ldc.i4.s 0x0f
2128         IL_0016:  ldc.i4.s 0x10
2129         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)
2130         IL_0028:  ret 
2131     } // end of method main::Main
2132
2133         .class nested private auto ansi beforefieldinit R1
2134            extends [mscorlib]System.MarshalByRefObject
2135         {
2136                 .field  public  int32 test_field
2137
2138         .method public hidebysig  specialname  rtspecialname
2139                         instance default void '.ctor' ()  cil managed
2140         {
2141                         ret
2142                 }
2143         }
2144
2145         .method public static hidebysig
2146                         default int32 return_0 () cil managed
2147         {
2148                 ldc.i4.0
2149                 ret
2150         }
2151
2152         .method public static hidebysig
2153                         default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2154         {
2155                 .locals init (
2156                         class Tests/R1 v_0
2157                 )
2158
2159                 newobj instance void class Tests/R1::.ctor ()
2160                 stloc.0
2161                 ldloc.0
2162                 ldc.i4.0
2163                 volatile.
2164                 stfld int32 Tests/R1::test_field
2165                 call int32 class Tests::return_0 ()
2166                 ldc.i4.1
2167                 add
2168                 ret
2169         }
2170
2171         .method public static default int32 return_2 () cil managed
2172         {
2173                 // Prevent inlining
2174                 ldc.i4.s 16
2175         localloc
2176                 pop
2177                 ldc.i4.s 2
2178                 ret
2179         }
2180
2181         .method public static hidebysig
2182                         default int32 test_1_cmov_opt_regress_463357 () cil managed
2183         {
2184                 call int32 class Tests::return_2 ()
2185                 ldc.i4.0
2186                 ceq
2187                 brfalse L1
2188                 ldc.i4.0
2189                 ret
2190                 br L2
2191         L1: nop
2192         L2: nop
2193                 ldc.i4.1
2194                 ret
2195         }
2196
2197    .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1)  cil managed 
2198    {
2199       .maxstack 3
2200       .locals init (int32 V_0, bool V_1, bool V_2)
2201       
2202           ldc.i4.0
2203       IL_000b:  stloc.1 
2204       IL_000d:  br IL_002f
2205
2206           ldc.i4.1    
2207           stloc.2
2208       IL_001e:  ldloc.2 
2209       IL_001f:  brfalse IL_0036
2210
2211       IL_0024:  
2212       IL_002a:  br IL_0041
2213     
2214       IL_002f:  ldloc.1
2215       IL_0030:  stloc.2 
2216       IL_0031:  br IL_001e
2217     
2218       IL_0036:  ldc.i4 0
2219       IL_003b:  stloc.0 
2220       IL_003c:  br IL_0041
2221     
2222       IL_0041:  ldloc.0 
2223       IL_0042:  ret 
2224   } 
2225
2226     .method public static default int32 test_0_cmov_opt_regress_474718 ()  cil managed 
2227     {
2228         .maxstack 16
2229         ldc.i4.1
2230         call int32 Tests::cmov_opt_regress_474718_inner (int32)
2231         ret
2232    }
2233
2234         .method public static default int32 test_5_createarr_newobj () cil managed
2235         {
2236                 .maxstack 16
2237
2238                 ldc.i4 5
2239                 newobj void char[]::.ctor(int32)
2240                 ldlen
2241                 ret
2242         }
2243
2244         .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
2245         {
2246                 .maxstack 16
2247                 .locals init (native int)
2248
2249                 ldc.i4.s 10
2250                 localloc
2251                 stloc.0
2252
2253                 // Set the first value to 3
2254                 ldloc.0
2255                 ldc.i4.0
2256                 add             //addr
2257                 ldc.i4.3        //value
2258                 stind.i1
2259
2260                 // Zero out the first 3 values
2261                 ldloc.0         //addr
2262                 ldc.i4.0        //value
2263                 ldc.i4.s 3      //size
2264                 initblk
2265
2266                 // Load the first value
2267                 ldloc.0
2268                 ldc.i4.0
2269                 add     
2270                 ldind.u1
2271                 conv.i4
2272                 ret
2273         }
2274
2275         .method public static float32 GetFloat32() cil managed noinlining
2276         {
2277                 .maxstack  8
2278                 ldc.r8     0.19975845134874831
2279                 ret
2280         }
2281
2282 /*         Disabled until they can be fixed to run on amd64
2283         .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
2284         {
2285                 .maxstack 16
2286
2287                 call float32 Tests::GetFloat32()
2288                 ldc.r8     0.19975845134874831
2289                 beq OK
2290
2291                 ldc.i4.1
2292                 ret
2293 OK:
2294                 ldc.i4.0
2295                 ret
2296         }
2297 */
2298
2299         .method public static default int32 test_0_long_to_r8_un_overflow () cil managed
2300         {
2301                 .maxstack 16
2302                 ldc.i8     0x00FFFFFFFFFFFFFF
2303                 conv.r.un
2304                 conv.i8
2305                 ldc.i8 0x100000000000000
2306                 beq OK_1
2307
2308                 ldc.i4.1
2309                 ret
2310 OK_1:
2311                 ldc.i8     0x00FFFFFFFFFFFFFF
2312                 conv.r.un
2313                 conv.r8
2314                 conv.i8
2315                 ldc.i8 0x100000000000000
2316                 beq OK_2
2317
2318                 ldc.i4.2
2319                 ret
2320 OK_2:
2321                 ldc.i4.0
2322                 ret
2323         }
2324
2325         .field public static int32 shift1
2326
2327         .method public static int32 regress_497271_helper (int32 i) cil managed
2328         {
2329                 ldarg.0
2330                 ret
2331         }
2332
2333         .method public static int32 test_0_regalloc_regress_497271 () cil managed
2334         {
2335                 .locals init (int32 var)
2336
2337                 ldc.i4  4
2338                 stsfld  int32 Tests::shift1
2339                 ldsfld  int32 Tests::shift1
2340                 stloc   var
2341                 ldc.i4  4660
2342                 ldloc   var
2343                 shr.un
2344                 ldc.i4  4660
2345                 ldc.i4  32
2346                 ldloc   var
2347                 sub
2348                 shl
2349                 or
2350                 ldc.i4  1073742115
2351                 beq     ?L10
2352 ?L9:
2353                 ldc.i4  1
2354                 call    int32 Tests::regress_497271_helper (int32)
2355                 ret
2356 ?L10:
2357                 ldc.i4  0
2358                 call    int32 Tests::regress_497271_helper (int32)
2359                 ret
2360         }
2361
2362    .field  private static  int32 Value
2363
2364   .method public static hidebysig  specialname 
2365           default int32 regress_513931_inner ()  cil managed 
2366     {                                                                 
2367         // Method begins at RVA 0x225c                                
2368         // Code size 52 (0x34)                                        
2369         .maxstack 2                                                   
2370         .locals init (                                                
2371                 int32   V_0,                                          
2372                 int32   V_1,                                          
2373                 bool    V_2)
2374                        
2375                                 ldc.i4 999
2376                                 stsfld int32 Tests::Value
2377
2378         IL_0000:  nop                                                 
2379         IL_0001:  ldsfld int32 Tests::Value      
2380         IL_0006:  stloc.0                                             
2381         IL_0007:  ldloc.0                                             
2382         IL_0008:  ldc.i4.0                                            
2383         IL_0009:  cgt                                                 
2384         IL_000b:  ldc.i4.0                                            
2385         IL_000c:  ceq                                                 
2386         IL_000e:  stloc.2                                             
2387         IL_000f:  ldloc.2                                             
2388         IL_0010:  brtrue.s IL_0027                                    
2389
2390         IL_0012:  nop 
2391         IL_0013:  ldloc.0 
2392         IL_0014:  ldc.i4.s 0x7b
2393         IL_0016:  ceq          
2394         IL_0018:  ldc.i4.0     
2395         IL_0019:  ceq          
2396         IL_001b:  stloc.2      
2397         IL_001c:  ldloc.2      
2398         IL_001d:  brtrue.s IL_0023
2399
2400         IL_001f:  ldc.i4.m1 
2401         IL_0020:  stloc.1   
2402         IL_0021:  br.s IL_0032
2403
2404         IL_0023:  ldc.i4.1 
2405         IL_0024:  stloc.1  
2406         IL_0025:  br.s IL_0032
2407
2408         IL_0027:  
2409         IL_002c:  newobj instance void class [mscorlib]System.Exception::'.ctor'()
2410         IL_0031:  throw                                                                            
2411         IL_0032:  ldloc.1                                                                          
2412         IL_0033:  ret                                                                              
2413     }
2414
2415         .method public static hidebysig  specialname 
2416          default int32 test_0_regress_513931 ()  cil managed 
2417         {
2418                 call int32 Tests::regress_513931_inner ()
2419                 pop
2420                 ldc.i4.0
2421                 ret
2422         }
2423
2424         .method public static default int32 test_0_newarr_i8 () cil managed
2425         {
2426                 ldc.i4 1000
2427                 conv.i8
2428                 newarr [mscorlib]System.Boolean
2429                 pop
2430                 ldc.i4 0
2431                 ret
2432         }
2433
2434         .method public static specialname 
2435                default int32 return_1_noinline ()  cil managed noinlining 
2436         {
2437                 .maxstack 0
2438
2439                 ldc.i4.1
2440                 ret 
2441         }
2442
2443         // Only happens with -O=-deadce,cmov
2444         .method public static default int32 test_0_cmov_unused_582322 () cil managed
2445         {
2446         .maxstack 2                                                   
2447         .locals init (                                                
2448                                 int32 V_0
2449                 )                               
2450                 call int32 Tests::return_1_noinline ()
2451                 ldc.i4.1
2452                 bne.un L0
2453                 ldloc.s 0
2454                 pop
2455         L0:
2456                 ldc.i4.0
2457                 ret
2458         }
2459
2460     .method public static  hidebysig 
2461            default int32 test_0_regress_586664 ()  cil managed 
2462     {                                        
2463         // Method begins at RVA 0x20f4       
2464         // Code size 76 (0x4c)               
2465         .maxstack 6                          
2466         .locals init (                       
2467                 float64 V_0,                 
2468                 float64[]       V_1)         
2469         IL_0000:  ldc.r8 1.                  
2470         IL_0009:  ldc.r8 2.                  
2471         IL_0012:  ldc.r8 1.                  
2472         IL_001b:  call float64 class [mscorlib]System.Math::Pow(float64, float64)
2473         IL_0020:  div                                                            
2474         IL_0021:  stloc.0                                                        
2475         IL_0022:  ldc.i4.2                                                       
2476         IL_0023:  newarr [mscorlib]System.Double                                 
2477         IL_0028:  dup                                                            
2478         IL_0029:  ldc.i4.0                                                       
2479         IL_002a:  ldloc.0                                                        
2480         IL_002b:  neg                                                            
2481         IL_002c:  stelem.r8                                                      
2482         IL_002d:  dup                                                            
2483         IL_002e:  ldc.i4.1                                                       
2484         IL_002f:  ldloc.0
2485         IL_0030:  neg
2486         IL_0031:  stelem.r8
2487         IL_0032:  stloc.1
2488         IL_0033:  ldloc.1
2489         IL_0034:  ldc.i4.0
2490         IL_0035:  ldelem.r8
2491         IL_0036:  ldc.r8 -0.5
2492         IL_003f:  bne.un IL_004a
2493
2494         IL_0044:  ldc.i4.0
2495         IL_0045:  br IL_004b
2496
2497         IL_004a:  ldc.i4.1
2498         IL_004b:  ret
2499     }
2500
2501         .method public static int32 test_2_leave_multiple_blocks_from_end ()
2502         {
2503                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2504                 .locals init (int32 V_0)
2505
2506                 .try {
2507                         .try {
2508                                 nop
2509                                 nop
2510                                 leave END
2511                         } finally {
2512                                 ldloc.0
2513                                 ldc.i4.1
2514                                 add
2515                                 stloc.0
2516                                 endfinally
2517                         }
2518                         nop
2519                         leave END
2520                 } finally {
2521                         ldloc.0
2522                         ldc.i4.1
2523                         add
2524                         stloc.0
2525                         endfinally
2526                 }
2527 END:
2528                 ldloc.0
2529                 ret
2530         }
2531
2532         .method public static int32 test_3_leave_multiple_blocks_from_hole ()
2533         {
2534                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2535                 .locals init (int32 V_0)
2536
2537                 .try {
2538                         .try {
2539                                 ldloc.0
2540                                 brtrue REST
2541                                 leave BEFORE_END
2542 REST:
2543                                 nop
2544                                 nop
2545                                 leave END
2546                         } finally {
2547                                 ldloc.0
2548                                 ldc.i4.1
2549                                 add
2550                                 stloc.0
2551                                 endfinally
2552                         }
2553                         nop
2554                         leave END
2555                 } finally {
2556                         ldloc.0
2557                         ldc.i4.1
2558                         add
2559                         stloc.0
2560                         endfinally
2561                 }
2562 BEFORE_END:
2563                 ldloc.0
2564                 ldc.i4.1
2565                 add
2566                 stloc.0
2567 END:
2568                 ldloc.0
2569                 ret
2570         }
2571
2572         .class nested private auto ansi sealed beforefieldinit Pair`2<TKey,TValue>
2573                    extends [mscorlib]System.ValueType
2574         {
2575                 .field  public  !0 key
2576         .field  public  !1 'value'
2577         }
2578
2579     .method private static hidebysig 
2580            default bool ContentEquals<TKey,TValue> (valuetype Tests/Pair`2<!!TKey, !!TValue> v)  cil managed 
2581     {
2582         .maxstack 8
2583         IL_0000:  ldarga.s 0 
2584         IL_0006:  ldnull 
2585                           constrained. valuetype Tests/Pair`2<!!0,!!1>
2586         IL_0007:  callvirt instance bool class [mscorlib]System.Object::Equals(object)
2587                           ret
2588     }
2589
2590     .method public static hidebysig default int32 test_0_constrained_gshared_595863 () cil managed
2591     {
2592                 .locals init (
2593                 valuetype Tests/Pair`2<string, string>  V_0,
2594                 valuetype Tests/Pair`2<string, string>  V_1)
2595         IL_0000:  ldloca.s 0
2596         IL_0002:  initobj valuetype Tests/Pair`2<string,string>
2597         IL_0008:  ldloc.0 
2598         IL_0009:  stloc.1 
2599         IL_000a:  ldloca.s 1
2600         IL_000c:  ldstr "A"
2601         IL_0011:  stfld !0 valuetype Tests/Pair`2<string,string>::key
2602         IL_0016:  ldloca.s 1
2603         IL_0018:  ldstr "B"
2604         IL_001d:  stfld !1 valuetype Tests/Pair`2<string,string>::'value'
2605         IL_0022:  ldloc.1 
2606         IL_0023:  stloc.0 
2607         IL_0024:  ldloc.0 
2608         IL_0025:  call bool class Tests::ContentEquals<string, string> (valuetype Tests/Pair`2<!!0,!!1>)
2609                           brfalse SUCCESS
2610                           ldc.i4.1
2611                           ret
2612         SUCCESS:
2613                           ldc.i4.0
2614                           ret
2615     }
2616
2617         .method public static default int32 test_0_wrap_non_exception_throws () cil managed
2618         {
2619           .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2620           .try {
2621                     newobj instance void class [mscorlib]System.Object::'.ctor'()
2622                         throw
2623                   leave IL_0
2624           } catch class [mscorlib]System.Runtime.CompilerServices.RuntimeWrappedException {
2625                   leave IL_0
2626                 }
2627                 IL_0:
2628                 ldc.i4.0
2629                 ret
2630     }
2631
2632         .method public static default int32 test_0_typespec_modopt () cil managed {
2633                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2634                 ldtoken class Tests modopt (Tests)
2635                 pop
2636                 ldc.i4.0
2637                 ret
2638         }
2639
2640         .method public hidebysig static int32 SizeOfT<T>() cil managed
2641         {
2642                 .maxstack  8
2643     
2644                 sizeof !!0
2645         ret
2646         }
2647
2648         .method public static default int32 test_1_sizeof_gshared () cil managed {
2649                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2650             call   int32 Tests::SizeOfT<int8>()
2651                 ldc.i4.1
2652                 ceq
2653                 ret
2654         }
2655
2656         .method public static default int32 test_1_sizeof_ref () cil managed {
2657             call   int32 Tests::SizeOfT<object>()
2658                 sizeof [mscorlib]System.IntPtr
2659                 ceq
2660                 ret
2661         }
2662
2663   .field static public int32 volatile_int
2664
2665         .method public static default int32 test_5_volatile_load_store () cil managed {
2666                 ldsflda int32 class Tests::volatile_int
2667                 ldc.i4 5
2668                 volatile.
2669                 stind.i4
2670                 ldsflda int32 class Tests::volatile_int
2671                 volatile.
2672                 ldind.i4
2673                 ret
2674         }               
2675
2676     .method public static 
2677            default int32 regress_693905_inner (int32 x, int32 acc)  cil managed 
2678     {
2679         // Method begins at RVA 0x2050
2680         // Code size 17 (0x11)
2681         .maxstack 5
2682         IL_0000:  ldarg.0 
2683         IL_0001:  brtrue.s IL_0005
2684
2685         IL_0003:  ldarg.1 
2686         IL_0004:  ret 
2687         IL_0005:  ldarg.0 
2688         IL_0006:  ldc.i4.1 
2689         IL_0007:  sub 
2690         IL_0008:  ldarg.1 
2691         IL_0009:  ldc.i4.1 
2692         IL_000a:  add 
2693         IL_000b:  starg.s 1
2694         IL_000d:  starg.s 0
2695         IL_000f:  br.s IL_0000
2696
2697     } // end of method Test::f
2698
2699     .method public static 
2700            default int32 test_10_regress_693905 ()  cil managed 
2701         {
2702                 ldc.i4.s 0x0a
2703         ldc.i4.0 
2704         call int32 class Tests::regress_693905_inner(int32, int32)
2705                 ret
2706         }
2707
2708         .method public static
2709                         default int32 test_0_llvm_regress_171 () cil managed
2710         {
2711                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2712                 .locals init (
2713                         int32 i
2714                 )
2715
2716                 call int32 Tests::return_1_noinline ()
2717                 ldc.i4.1
2718                 beq L1
2719                 ldc.i4.1
2720                 stloc.s 0
2721                 call int32 Tests::return_1_noinline ()
2722                 ldc.i4.0
2723                 beq L1
2724                 L1:
2725                 ldloc.s 0
2726                 ret
2727         }
2728
2729      .field  public static int32 static_a
2730
2731         .method public static
2732                         default int32 test_4_ldfld_stfld_static () cil managed
2733         {
2734                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 0C 21 49 4E 54 45 52 50 52 45 54 45 52 00 00 )   // ...!INTERPRETER.
2735                 ldnull
2736                 ldc.i4 2
2737                 stfld int32 Tests::static_a
2738                 ldnull
2739                 ldfld int32 Tests::static_a
2740                 ldnull
2741                 ldflda int32 Tests::static_a
2742                 ldind.i4
2743                 add
2744                 ret
2745         }
2746
2747   .method public static default int32 no_initlocals_inner () cil managed
2748   {
2749     .locals (
2750         int32 V_0,
2751         float32 V_1,
2752         float64 V_2,
2753         valuetype Tests/TailCallStruct V_3)
2754        ldloc V_0
2755        ret
2756   }
2757
2758   .method public static default int32 test_0_no_initlocals () cil managed
2759   {
2760        call int32 Tests::no_initlocals_inner()
2761        pop
2762            ldc.i4.0
2763        ret
2764   }
2765
2766   .method public hidebysig static int32  test_5_r4_fadd_mixed() cil managed
2767   {
2768     // Code size       17 (0x11)
2769     .maxstack  2
2770     .locals init (float32 V_0,
2771              float64 V_1)
2772     IL_0000:  ldc.r4     3
2773     IL_0005:  stloc.0
2774     IL_0006:  ldc.r8     2
2775     IL_000b:  stloc.1
2776     IL_000c:  ldloc.0
2777     IL_000d:  ldloc.1
2778     IL_000e:  add
2779     IL_000f:  conv.i4
2780     IL_0010:  ret
2781   }
2782
2783  .method public hidebysig static int32  test_0_fcmp_eq_r4_mixed() cil managed
2784   {
2785     // Code size       32 (0x20)
2786     .maxstack  2
2787     .locals init (float32 V_0,
2788              float64 V_1)
2789     IL_0000:  ldc.r4     1
2790     IL_0005:  stloc.0
2791     IL_0006:  ldc.r8     1
2792     IL_000f:  stloc.1
2793     IL_0010:  ldloc.0
2794     IL_0012:  ldloc.1
2795     IL_0013:  bne.un     IL_001e
2796
2797     IL_0018:  ldc.i4.0
2798     IL_0019:  br         IL_001f
2799
2800     IL_001e:  ldc.i4.1
2801     IL_001f:  ret
2802   } // end of method Tests::test_0_fcmp_eq_r4_mixed
2803
2804   .method public hidebysig static int32  test_0_fceq_r4_mixed() cil managed
2805   {
2806     // Code size       31 (0x1f)
2807     .maxstack  2
2808     .locals init (float32 V_0,
2809              float64 V_1,
2810              bool V_2)
2811     IL_0000:  ldc.r4     1
2812     IL_0005:  stloc.0
2813     IL_0006:  ldc.r8     1
2814     IL_000b:  stloc.1
2815     IL_000c:  ldloc.0
2816     IL_000d:  ldloc.1
2817     IL_000e:  ceq
2818     IL_0010:  stloc.2
2819     IL_0011:  ldloc.2
2820     IL_0012:  brfalse    IL_001d
2821
2822     IL_0017:  ldc.i4.0
2823     IL_0018:  br         IL_001e
2824
2825     IL_001d:  ldc.i4.1
2826     IL_001e:  ret
2827   } // end of method Tests::test_0_fceq_r4
2828
2829   .method public static int32 test_0_switch_loop () cil managed
2830   {
2831         .maxstack 16
2832         .locals init (valuetype Tests/TailCallStruct V_0, int32 V_1)
2833         ldc.i4.0
2834         ldloc.0
2835         ldloc.1
2836         brtrue L_1
2837         L_0:
2838         ldc.i4.4
2839         switch (L_0)
2840         L_1:
2841         pop
2842         ret
2843   }
2844 }