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