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