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