[interp] transform all kind of clauses
[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                 .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.
1301                 .maxstack 8
1302                 .locals init (  
1303                                 valuetype Tests/TheStruct v_0, 
1304                                 valuetype Tests/TheStruct v_1
1305                                          )
1306
1307                 ldloca v_0
1308                 ldc.i4.2
1309                 stfld int32 Tests/TheStruct::a
1310
1311                 ldloca v_0
1312                 ldc.i4.3
1313                 stfld int32 Tests/TheStruct::b
1314
1315                 ldloca v_1
1316                 ldloca v_0
1317                 cpobj Tests/TheStruct
1318
1319                 ldloca v_1
1320                 ldfld int32 Tests/TheStruct::a
1321                 ldloca v_1
1322                 ldfld int32 Tests/TheStruct::b
1323                 add
1324
1325                 ret
1326         }
1327
1328         .method public static int32 test_5_ldobj_stloc_optimization () {
1329                 .maxstack 8
1330                 .locals init (  
1331                                 valuetype Tests/TheStruct v_0, 
1332                                 valuetype Tests/TheStruct v_1
1333                                          )
1334
1335                 ldloca v_0
1336                 ldc.i4.2
1337                 stfld int32 Tests/TheStruct::a
1338
1339                 ldloca v_0
1340                 ldc.i4.3
1341                 stfld int32 Tests/TheStruct::b
1342
1343                 ldloca v_0
1344                 ldobj valuetype Tests/TheStruct
1345                 stloc.s v_1
1346
1347                 ldloca v_1
1348                 ldfld int32 Tests/TheStruct::a
1349                 ldloca v_1
1350                 ldfld int32 Tests/TheStruct::b
1351                 add
1352
1353                 ret
1354         }
1355
1356         .method public static int32 test_1_cpobj_reference () {
1357                 .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.
1358                 .maxstack 8
1359                 .locals init (  
1360                                 object v_0, 
1361                                 object v_1
1362                                          )
1363
1364                 newobj instance void object::.ctor()
1365                 stloc v_0
1366
1367                 ldloca v_1
1368                 ldloca v_0
1369                 cpobj object
1370
1371                 ldloc v_0
1372                 ldloc v_1
1373                 ceq
1374                 ret
1375         }
1376
1377         .method public static int32 test_1_initobj_reference () {
1378                 .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.
1379                 .maxstack 8
1380                 .locals init (  
1381                                 object v_0
1382                                          )
1383
1384                 newobj instance void object::.ctor()
1385                 stloc v_0
1386
1387                 ldloca v_0
1388                 initobj object
1389
1390                 ldloc v_0
1391                 ldnull
1392                 ceq
1393                 ret
1394         }
1395
1396         .method public static int32 test_1_ldobj_reference () {
1397                 .maxstack 8
1398                 .locals init (  
1399                                 object v_0
1400                                          )
1401
1402                 newobj instance void object::.ctor()
1403                 stloc v_0
1404
1405                 ldloc v_0
1406                 ldloca v_0
1407                 ldobj object
1408                 ceq
1409                 ret
1410         }
1411
1412         .method public static int32 test_5_vtype_on_bb_boundary () {
1413                 .maxstack 8
1414                 .locals init (  
1415                                 valuetype Tests/TheStruct v_0, 
1416                                 valuetype Tests/TheStruct v_1
1417                                          )
1418
1419                 ldloca v_0
1420                 ldc.i4.2
1421                 stfld int32 Tests/TheStruct::a
1422
1423                 ldloca v_0
1424                 ldc.i4.3
1425                 stfld int32 Tests/TheStruct::b
1426
1427                 ldloc v_0
1428                 br L_0
1429         L_0: stloc v_1
1430
1431                 ldloca v_1
1432                 ldfld int32 Tests/TheStruct::a
1433                 ldloca v_1
1434                 ldfld int32 Tests/TheStruct::b
1435                 add
1436                 ret
1437         }
1438
1439         .method public static int32 test_5_different_in_stacks () cil managed {
1440                 .maxstack 16
1441
1442                         ldc.i4.1
1443                         ldc.i4.1
1444                         beq L_0
1445
1446                         ldc.i4.3
1447                         ldc.i4.3
1448                         br L_1
1449                         ldc.i4.3
1450                         ldc.i4.3
1451                         br L_2
1452          L_0:   ldc.i4.2
1453                         ldc.i4.3
1454                         ldc.i4.1
1455                         ldc.i4.1
1456                         beq L_2
1457          L_1:   add
1458                         ret
1459          L_2:   add
1460                         ret
1461         }
1462
1463         .method public static int32 test_3_larray_get_set () {
1464                 .locals init (
1465                         int32[2]        V_0)
1466                           
1467                         ldc.i4.2 
1468                         newobj instance void int32[0...]::.ctor(int32)
1469                         stloc.0 
1470                         ldloc.0 
1471                         ldc.i4.0 
1472                         ldc.i4 1
1473                         call instance void int32[0...]::Set(int32, int32)
1474                     ldloc.0 
1475                     ldc.i4.1 
1476                         ldc.i4 2
1477                         call instance void int32[0...]::Set(int32, int32)
1478
1479                         ldloc.0
1480                         ldc.i4.0
1481                         call instance int32 int32[0...]::Get(int32)
1482                         ldloc.0
1483                         ldc.i4.1
1484                         call instance int32 int32[0...]::Get(int32)
1485                         add
1486                         ret
1487         }
1488
1489         .method public static int32 test_0_pop_side_effects () {
1490                 .try {
1491                         ldc.r8 1
1492                         ldc.r8 0
1493                         div
1494                         ckfinite
1495                         pop
1496                         leave FAIL
1497                 }
1498                 catch [mscorlib]System.ArithmeticException {
1499                         pop
1500                         leave L_0
1501                 }
1502                 L_0:
1503                 ldc.i4.0
1504                 ret
1505                 FAIL:
1506                 ldc.i4.1
1507                 ret
1508         }
1509
1510         .method public static void regalloc_regress_78314_helper (object o) cil managed
1511         {
1512                 ret
1513         }
1514
1515         .method public static int32 test_1_regalloc_regress_78314 () cil managed
1516         {
1517     // Code size       68 (0x44)
1518     .maxstack  6
1519     .locals init (int32 V_0, bool V_1)
1520     IL_0000:  ldc.i4.0
1521     IL_0001:  stloc.0
1522     IL_0002:  br.s       IL_003b
1523
1524     IL_0004:
1525     IL_001e:  ldc.i4.s   10
1526     IL_0020:  ldloc.0
1527     IL_0021:  shl
1528     IL_0022:  ldc.i4.s   10
1529     IL_0024:  ldloc.0
1530     IL_0025:  shl
1531     IL_0026:  ceq
1532     IL_0028:  box        [mscorlib]System.Boolean
1533     IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
1534     IL_0037:  ldloc.0
1535     IL_0038:  ldc.i4.1
1536     IL_0039:  add
1537     IL_003a:  stloc.0
1538     IL_003b:  ldloc.0
1539     IL_003c:  ldc.i4.8
1540     IL_003f:  blt.s      IL_0004
1541
1542         ldloc.0
1543         ldc.i4.8
1544         ceq
1545         conv.i4
1546         ret     
1547   }
1548
1549         .method public static void try_block_end_remove_if_useless () cil managed {
1550             .maxstack  8
1551
1552             T_START:
1553                 ldstr   "Start"
1554                         pop
1555                 leave.s COMPLETE
1556             T1_END:
1557
1558             COMPLETE:
1559                 ret
1560
1561             F1_START:
1562                 ldstr   "Finally1"
1563                         pop
1564                 endfinally
1565             F1_END:
1566
1567             .try T_START to T1_END finally handler F1_START to F1_END
1568         }
1569
1570         .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1571                 call void class Tests::try_block_end_remove_if_useless ()
1572                 ldc.i4.0
1573                 ret
1574         }
1575
1576    .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
1577     {
1578         ldc.i4.0
1579         switch (target)
1580         target: ldstr "bar"
1581                 pop
1582                 ldc.i4.0
1583         ret
1584     }
1585
1586         // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1587         // generate the non .un version of the opcodes
1588     .method private static  hidebysig 
1589            default int32 test_4_float_branch_nan ()  cil managed 
1590     {
1591         // Method begins at RVA 0x27a4
1592         // Code size 74 (0x4a)
1593         .maxstack 2
1594         .locals init (
1595                 float64 V_0,
1596                 float64 V_1,
1597                 int32   V_2)
1598         IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
1599         IL_0009:  stloc.0 
1600         IL_000a:  ldc.r8 1.
1601         IL_0013:  stloc.1 
1602         IL_0014:  ldc.i4.0 
1603         IL_0015:  stloc.2 
1604         IL_0016:  ldloc.0 
1605         IL_0017:  ldloc.1 
1606         IL_0018:  bge.s IL_001a
1607
1608                                 br L1
1609         IL_001a:  ldloc.2 
1610         IL_001b:  ret 
1611         L1:
1612         IL_001c:  ldloc.2 
1613         IL_001d:  ldc.i4.1 
1614         IL_001e:  add 
1615         IL_001f:  stloc.2 
1616         IL_0020:  ldloc.0 
1617         IL_0021:  ldloc.1 
1618         IL_0022:  ble.s IL_002e
1619                                 br L2
1620         IL_002e:  ldloc.2 
1621         IL_002f:  ret 
1622         L2:
1623         IL_0030:  ldloc.2 
1624         IL_0031:  ldc.i4.1 
1625         IL_0032:  add 
1626         IL_0033:  stloc.2 
1627         IL_0034:  ldloc.0 
1628         IL_0035:  ldloc.1 
1629         IL_0036:  blt.s IL_0038
1630                                 br L3           
1631         IL_0038:  ldloc.2 
1632         IL_0039:  ret 
1633         L3:
1634         IL_003a:  ldloc.2 
1635         IL_003b:  ldc.i4.1 
1636         IL_003c:  add 
1637         IL_003d:  stloc.2 
1638         IL_003e:  ldloc.0 
1639         IL_003f:  ldloc.1 
1640         IL_0040:  bgt.s IL_0042
1641                                 br L4
1642         IL_0042:  ldloc.2 
1643         IL_0043:  ret 
1644         L4:
1645         IL_0044:  ldloc.2 
1646         IL_0045:  ldc.i4.1 
1647         IL_0046:  add 
1648         IL_0047:  stloc.2 
1649         IL_0048:  ldloc.2 
1650         IL_0049:  ret 
1651     } // end of method Tests::test_5_float_branch_nan
1652
1653     .method private static  hidebysig
1654            default void regress_80622_inner (object x)  cil managed
1655     {
1656                 .locals init (unsigned int8 i)
1657         // Method begins at RVA 0x2050
1658         // Code size 14 (0xe)
1659         .maxstack 8
1660         IL_1000:  ldarg.0
1661         IL_1001:  unbox unsigned int8
1662         IL_1006:  ldobj unsigned int8
1663         IL_000b:  conv.ovf.i4.un
1664         IL_000c:  pop
1665         IL_000d:  ret
1666     }
1667
1668     // method line 2
1669     .method private static  hidebysig
1670            default int32 test_0_regress_80622 ()  cil managed
1671     {
1672         .maxstack 8
1673         IL_0000:  ldc.i4 255
1674         IL_0005:  box unsigned int8
1675         IL_000a:  call void class Tests::regress_80622_inner (object)
1676                 ldc.i4.0
1677         IL_000f:  ret
1678     }
1679
1680         .method private static default int32 test_0_regresss_80190 () cil managed
1681         {
1682             .maxstack  2
1683             .locals init (int32 V_0,
1684                      int32* V_1)
1685             IL_0000:  nop
1686             IL_0001:  nop
1687             IL_0002:  ldloca.s   V_0
1688             IL_0004:  conv.u
1689             IL_0005:  stloc.1
1690             IL_0006:  ldloc.1
1691             IL_0007:  ldc.i4.3
1692             IL_0008:  stind.i4
1693             IL_0009:  nop
1694                                   ldc.i4.0
1695                                   ret
1696         }
1697
1698         .class interface nested public auto ansi abstract IFaceWithStaticMethod
1699         {
1700             .method public static  specialname 
1701                default void foo ()  cil managed noinlining 
1702             {
1703                 .maxstack 0
1704                 IL_0000:  ret 
1705         }
1706         }
1707         
1708         .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1709         {
1710             .method public hidebysig  specialname  rtspecialname 
1711            instance default void .ctor ()  cil managed 
1712             {
1713                         .maxstack 8
1714                         ret
1715                 }
1716
1717         }
1718
1719         // Test that static methods in interfaces are ignored during vtable construction
1720         .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1721         {
1722                 .maxstack 16
1723
1724                 newobj instance void class Tests/AClass::.ctor()
1725                 pop
1726                 ldc.i4.0
1727                 ret
1728         }
1729
1730         .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
1731                 ldarg.0
1732                 box !!0
1733                 brtrue HAS_VALUE
1734                 ldc.i4.0
1735                 ret
1736 HAS_VALUE:      ldc.i4.1
1737                 ret
1738         }
1739
1740         // bug 78019
1741         .method static public int32 test_0_nullable_box_brtrue () cil managed {
1742
1743                 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1744
1745                 ldloc.0
1746                 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1747                 ret
1748         }
1749
1750         //Bug 372410
1751         .method static public int32 test_0_ldelema_type_check () cil managed {
1752                 .maxstack 16
1753                 .locals init (object[] V_0,
1754                                           object[,] V_1)
1755
1756                 ldc.i4.1
1757                 newarr object
1758                 stloc.0
1759
1760                 .try {
1761                         ldloc.0
1762                         ldc.i4.0
1763                         ldelema object
1764                         leave L1
1765                 } catch [mscorlib]System.ArrayTypeMismatchException {
1766                         leave ERROR1
1767                 }
1768
1769         L1:
1770                 ldc.i4.1
1771                 newarr string
1772                 stloc.0
1773
1774                 .try {
1775                         ldloc.0
1776                         ldc.i4.0
1777                         ldelema object
1778                         leave ERROR2
1779                 } catch [mscorlib]System.ArrayTypeMismatchException {
1780                         leave L2
1781                 }
1782
1783         L2:
1784                         ldc.i4.1
1785                 newarr string
1786                 stloc.0
1787
1788                 .try {
1789                         ldloc.0
1790                         ldc.i4.0
1791                         readonly. ldelema object
1792                         leave L3
1793                 } catch [mscorlib]System.ArrayTypeMismatchException {
1794                         leave ERROR3
1795                 }
1796
1797         L3:
1798                 ldc.i4.0
1799                 ret
1800
1801
1802         ERROR1:
1803                 ldc.i4.1
1804                 ret
1805
1806         ERROR2:
1807                 ldc.i4.2
1808                 ret
1809
1810         ERROR3:
1811                 ldc.i4.3
1812                 ret
1813         }
1814
1815
1816         //Bug 372410
1817         .method static public int32 test_0_array_address_type_check () cil managed {
1818                 .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.
1819                 .maxstack 16
1820                 .locals init (object[] V_0,
1821                                           object[,] V_1)
1822
1823                 ldc.i4.1 
1824             ldc.i4.1 
1825             newobj instance void object[,]::.ctor(int32, int32)
1826                 stloc.1
1827
1828                 .try {
1829                         ldloc.1
1830                         ldc.i4.0
1831                         ldc.i4.0
1832                         call instance object&  object[,]::Address(int32, int32)
1833                         leave L4
1834                 } catch [mscorlib]System.ArrayTypeMismatchException {
1835                         leave ERROR4
1836                 }
1837
1838         L4:
1839                 ldc.i4.1 
1840             ldc.i4.1 
1841             newobj instance void string[,]::.ctor(int32, int32)
1842                 stloc.1
1843
1844                 .try {
1845                         ldloc.1
1846                         ldc.i4.0
1847                         ldc.i4.0
1848                         call instance object&  object[,]::Address(int32, int32)
1849                         leave ERROR5
1850                 } catch [mscorlib]System.ArrayTypeMismatchException {
1851                         leave L5
1852                 }
1853
1854         L5:
1855                 ldc.i4.1 
1856             ldc.i4.1 
1857             newobj instance void string[,]::.ctor(int32, int32)
1858                 stloc.1
1859
1860                 .try {
1861                         ldloc.1
1862                         ldc.i4.0
1863                         ldc.i4.0
1864                         readonly. call instance object&  object[,]::Address(int32, int32)
1865                         leave L6
1866                 } catch [mscorlib]System.ArrayTypeMismatchException {
1867                         leave ERROR6
1868                 }
1869
1870         L6:
1871                 ldc.i4.0
1872                 ret
1873         ERROR4:
1874                 ldc.i4.4
1875                 ret
1876
1877         ERROR5:
1878                 ldc.i4.5
1879                 ret
1880
1881         ERROR6:
1882                 ldc.i4.6
1883                 ret
1884         }
1885
1886         .field public  static unsigned int64 'ull'
1887
1888         .field public  static int32 'shift2'
1889
1890         .method public static int32 test_0_long_shift_regalloc () cil managed
1891         {
1892                 .locals init (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
1893
1894                 .maxstack 4
1895
1896                 ldc.i8  81985529234382576
1897                 stsfld  unsigned int64 Tests::ull
1898             ldc.i4      60
1899                 stsfld  int32 Tests::shift2
1900
1901                 ldsfld  unsigned int64 Tests::ull
1902                 stloc   'cilsimp.27'
1903                 ldsfld  int32 Tests::shift2
1904                 stloc   'cilsimp.28'
1905                 ldloc   'cilsimp.27'
1906                 ldloc   'cilsimp.28'
1907                 shr.un
1908                 ldloc   'cilsimp.27'
1909                 ldc.i4  64
1910                 ldloc   'cilsimp.28'
1911                 sub
1912                 shl
1913                 or
1914                 ldc.i8  1311768467750121216
1915                 ceq
1916                 ldc.i4.1
1917                 xor
1918                 conv.u4
1919                 ret
1920         }
1921
1922         // Test calling ldfld directly on a vtype instead of a vtype address
1923         .method public static int32 test_5_call_ldfld_vtype () cil managed
1924         {
1925                 .maxstack 16
1926                 .locals init (
1927                         valuetype Tests/TailCallStruct arg
1928                 )
1929                 ldloca 0
1930                 ldc.i4.2
1931                 stfld int32 Tests/TailCallStruct::a
1932                 ldloca 0
1933                 ldc.i4.4
1934                 stfld int32 Tests/TailCallStruct::b
1935                 ldloc.0
1936                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
1937                 ldfld int32 Tests/TailCallStruct::a
1938                 ret
1939         }
1940
1941         .method public static int32 throw_ret () cil managed
1942         {
1943                 ldstr "FOO"
1944                 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
1945                 throw
1946                 ldc.i4.4
1947                 ret
1948         }
1949
1950         .method public static int32 throw2_ret () cil managed
1951         {
1952                 // Disable inlining
1953                 ldc.i4.5
1954                 localloc
1955                 pop
1956
1957                 call int32 Tests::throw_ret ()
1958                 ret
1959         }
1960
1961         // Test inlining a method which contains just a throw
1962         .method public static int32 test_0_inline_throw () cil managed
1963         {
1964                 .maxstack 16
1965                 .locals init (
1966                                 int32 v_0
1967                 )
1968
1969                 .try {
1970                         call int32 Tests::throw2_ret ()
1971                         stloc.0
1972                         leave L0
1973                 } catch [mscorlib]System.OverflowException {
1974                         pop
1975                         leave L1
1976                 }
1977
1978                 L0:
1979                         ldc.i4.1
1980                         ret
1981                 L1:
1982                         ldc.i4.0
1983                         ret                     
1984         }
1985
1986     .method public static int32 test_0_stelem_any_null_opt () cil managed
1987     {
1988                 .maxstack 16
1989                 .locals init (
1990                                 object[]        V_0,
1991                                 int32   V_1)
1992
1993                 ldc.i4.s 10
1994                 newarr [mscorlib]System.Object
1995                 stloc.0
1996
1997                 ldc.i4.0
1998                 stloc.1
1999                 br L0
2000
2001         L1:
2002                 ldloc.0
2003                 ldloc.1
2004                 ldnull
2005                 stelem.any [mscorlib]System.Object
2006                 ldloc.1
2007                 ldc.i4.1
2008                 add
2009                 stloc.1
2010         L0:
2011                 ldloc.1
2012                 ldc.i4.s 10
2013                 blt L1
2014
2015                 ldc.i4.0
2016                 ret
2017         }
2018
2019     // method line 2
2020     .method public static  hidebysig 
2021            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 
2022     {
2023         // Method begins at RVA 0x20f4
2024         // Code size 44 (0x2c)
2025         .maxstack 8
2026         IL_0000:  ldarg.0 
2027         IL_0001:  ldarg.1 
2028         IL_0002:  add 
2029         IL_0003:  ldarg.2 
2030         IL_0004:  add 
2031         IL_0005:  ldarg.3 
2032         IL_0006:  add 
2033         IL_0007:  ldarg.s 4
2034         IL_0009:  add 
2035         IL_000a:  ldarg.s 5
2036         IL_000c:  add 
2037         IL_000d:  ldarg.s 6
2038         IL_000f:  add 
2039         IL_0010:  ldarg.s 7
2040         IL_0012:  add 
2041         IL_0013:  ldarg.s 8
2042         IL_0015:  add 
2043         IL_0016:  ldarg.s 9
2044         IL_0018:  add 
2045         IL_0019:  ldarg.s 10
2046         IL_001b:  add 
2047         IL_001c:  ldarg.s 11
2048         IL_001e:  add 
2049         IL_001f:  ldarg.s 12
2050         IL_0021:  add 
2051         IL_0022:  ldarg.s 13
2052         IL_0024:  add 
2053         IL_0025:  ldarg.s 14
2054         IL_0027:  add 
2055         IL_0028:  ldarg.s 15
2056         IL_002a:  add 
2057         IL_002b:  ret 
2058     } // end of method main::callee
2059
2060     // method line 3
2061     .method public static  hidebysig 
2062            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 
2063     {
2064         // Method begins at RVA 0x2124
2065         // Code size 34 (0x22)
2066         .maxstack 17
2067         IL_0000:  ldarg.0 
2068                           ldc.i4.1
2069                           add
2070         IL_0001:  ldarg.1 
2071         IL_0002:  ldarg.2 
2072         IL_0003:  ldarg.3 
2073         IL_0004:  ldarg.s 4
2074         IL_0006:  ldarg.s 5
2075         IL_0008:  ldarg.s 6
2076         IL_000a:  ldarg.s 7
2077         IL_000c:  ldarg.s 8
2078         IL_000e:  ldarg.s 9
2079         IL_0010:  ldarg.s 10
2080         IL_0012:  ldarg.s 11
2081         IL_0014:  ldarg.s 12
2082         IL_0016:  ldarg.s 13
2083         IL_0018:  ldarg.s 14
2084                           ldc.i4.1
2085                           add
2086         IL_001a:  ldarg.s 15
2087                           ldc.i4.1
2088                           add
2089                   tail.
2090         IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
2091         IL_0021:  ret 
2092     } // end of method main::caller
2093
2094     // method line 4
2095     .method public static  hidebysig 
2096            default int32 test_139_many_args_tail_call ()  cil managed
2097     {
2098                 // Some platforms might not be able to AOT tail calls
2099                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
2100
2101         // Method begins at RVA 0x2154
2102         // Code size 43 (0x2b)
2103         .maxstack 17
2104         IL_0000:  ldc.i4.1 
2105         IL_0001:  ldc.i4.2 
2106         IL_0002:  ldc.i4.3 
2107         IL_0003:  ldc.i4.4 
2108         IL_0004:  ldc.i4.5 
2109         IL_0005:  ldc.i4.6 
2110         IL_0006:  ldc.i4.7 
2111         IL_0007:  ldc.i4.8 
2112         IL_0008:  ldc.i4.s 0x09
2113         IL_000a:  ldc.i4.s 0x0a
2114         IL_000c:  ldc.i4.s 0x0b
2115         IL_000e:  ldc.i4.s 0x0c
2116         IL_0010:  ldc.i4.s 0x0d
2117         IL_0012:  ldc.i4.s 0x0e
2118         IL_0014:  ldc.i4.s 0x0f
2119         IL_0016:  ldc.i4.s 0x10
2120         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)
2121         IL_0028:  ret 
2122     } // end of method main::Main
2123
2124         .class nested private auto ansi beforefieldinit R1
2125            extends [mscorlib]System.MarshalByRefObject
2126         {
2127                 .field  public  int32 test_field
2128
2129         .method public hidebysig  specialname  rtspecialname
2130                         instance default void '.ctor' ()  cil managed
2131         {
2132                         ret
2133                 }
2134         }
2135
2136         .method public static hidebysig
2137                         default int32 return_0 () cil managed
2138         {
2139                 ldc.i4.0
2140                 ret
2141         }
2142
2143         .method public static hidebysig
2144                         default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2145         {
2146                 .locals init (
2147                         class Tests/R1 v_0
2148                 )
2149
2150                 newobj instance void class Tests/R1::.ctor ()
2151                 stloc.0
2152                 ldloc.0
2153                 ldc.i4.0
2154                 volatile.
2155                 stfld int32 Tests/R1::test_field
2156                 call int32 class Tests::return_0 ()
2157                 ldc.i4.1
2158                 add
2159                 ret
2160         }
2161
2162         .method public static default int32 return_2 () cil managed
2163         {
2164                 // Prevent inlining
2165                 ldc.i4.s 16
2166         localloc
2167                 pop
2168                 ldc.i4.s 2
2169                 ret
2170         }
2171
2172         .method public static hidebysig
2173                         default int32 test_1_cmov_opt_regress_463357 () cil managed
2174         {
2175                 call int32 class Tests::return_2 ()
2176                 ldc.i4.0
2177                 ceq
2178                 brfalse L1
2179                 ldc.i4.0
2180                 ret
2181                 br L2
2182         L1: nop
2183         L2: nop
2184                 ldc.i4.1
2185                 ret
2186         }
2187
2188    .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1)  cil managed 
2189    {
2190       .maxstack 3
2191       .locals init (int32 V_0, bool V_1, bool V_2)
2192       
2193           ldc.i4.0
2194       IL_000b:  stloc.1 
2195       IL_000d:  br IL_002f
2196
2197           ldc.i4.1    
2198           stloc.2
2199       IL_001e:  ldloc.2 
2200       IL_001f:  brfalse IL_0036
2201
2202       IL_0024:  
2203       IL_002a:  br IL_0041
2204     
2205       IL_002f:  ldloc.1
2206       IL_0030:  stloc.2 
2207       IL_0031:  br IL_001e
2208     
2209       IL_0036:  ldc.i4 0
2210       IL_003b:  stloc.0 
2211       IL_003c:  br IL_0041
2212     
2213       IL_0041:  ldloc.0 
2214       IL_0042:  ret 
2215   } 
2216
2217     .method public static default int32 test_0_cmov_opt_regress_474718 ()  cil managed 
2218     {
2219         .maxstack 16
2220         ldc.i4.1
2221         call int32 Tests::cmov_opt_regress_474718_inner (int32)
2222         ret
2223    }
2224
2225         .method public static default int32 test_5_createarr_newobj () cil managed
2226         {
2227                 .maxstack 16
2228
2229                 ldc.i4 5
2230                 newobj void char[]::.ctor(int32)
2231                 ldlen
2232                 ret
2233         }
2234
2235         .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
2236         {
2237                 .maxstack 16
2238                 .locals init (native int)
2239
2240                 ldc.i4.s 10
2241                 localloc
2242                 stloc.0
2243
2244                 // Set the first value to 3
2245                 ldloc.0
2246                 ldc.i4.0
2247                 add             //addr
2248                 ldc.i4.3        //value
2249                 stind.i1
2250
2251                 // Zero out the first 3 values
2252                 ldloc.0         //addr
2253                 ldc.i4.0        //value
2254                 ldc.i4.s 3      //size
2255                 initblk
2256
2257                 // Load the first value
2258                 ldloc.0
2259                 ldc.i4.0
2260                 add     
2261                 ldind.u1
2262                 conv.i4
2263                 ret
2264         }
2265
2266         .method public static float32 GetFloat32() cil managed noinlining
2267         {
2268                 .maxstack  8
2269                 ldc.r8     0.19975845134874831
2270                 ret
2271         }
2272
2273 /*         Disabled until they can be fixed to run on amd64
2274         .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
2275         {
2276                 .maxstack 16
2277
2278                 call float32 Tests::GetFloat32()
2279                 ldc.r8     0.19975845134874831
2280                 beq OK
2281
2282                 ldc.i4.1
2283                 ret
2284 OK:
2285                 ldc.i4.0
2286                 ret
2287         }
2288 */
2289
2290         .method public static default int32 test_0_long_to_r8_un_overflow () cil managed
2291         {
2292                 .maxstack 16
2293                 ldc.i8     0x00FFFFFFFFFFFFFF
2294                 conv.r.un
2295                 conv.i8
2296                 ldc.i8 0x100000000000000
2297                 beq OK_1
2298
2299                 ldc.i4.1
2300                 ret
2301 OK_1:
2302                 ldc.i8     0x00FFFFFFFFFFFFFF
2303                 conv.r.un
2304                 conv.r8
2305                 conv.i8
2306                 ldc.i8 0x100000000000000
2307                 beq OK_2
2308
2309                 ldc.i4.2
2310                 ret
2311 OK_2:
2312                 ldc.i4.0
2313                 ret
2314         }
2315
2316         .field public static int32 shift1
2317
2318         .method public static int32 regress_497271_helper (int32 i) cil managed
2319         {
2320                 ldarg.0
2321                 ret
2322         }
2323
2324         .method public static int32 test_0_regalloc_regress_497271 () cil managed
2325         {
2326                 .locals init (int32 var)
2327
2328                 ldc.i4  4
2329                 stsfld  int32 Tests::shift1
2330                 ldsfld  int32 Tests::shift1
2331                 stloc   var
2332                 ldc.i4  4660
2333                 ldloc   var
2334                 shr.un
2335                 ldc.i4  4660
2336                 ldc.i4  32
2337                 ldloc   var
2338                 sub
2339                 shl
2340                 or
2341                 ldc.i4  1073742115
2342                 beq     ?L10
2343 ?L9:
2344                 ldc.i4  1
2345                 call    int32 Tests::regress_497271_helper (int32)
2346                 ret
2347 ?L10:
2348                 ldc.i4  0
2349                 call    int32 Tests::regress_497271_helper (int32)
2350                 ret
2351         }
2352
2353    .field  private static  int32 Value
2354
2355   .method public static hidebysig  specialname 
2356           default int32 regress_513931_inner ()  cil managed 
2357     {                                                                 
2358         // Method begins at RVA 0x225c                                
2359         // Code size 52 (0x34)                                        
2360         .maxstack 2                                                   
2361         .locals init (                                                
2362                 int32   V_0,                                          
2363                 int32   V_1,                                          
2364                 bool    V_2)
2365                        
2366                                 ldc.i4 999
2367                                 stsfld int32 Tests::Value
2368
2369         IL_0000:  nop                                                 
2370         IL_0001:  ldsfld int32 Tests::Value      
2371         IL_0006:  stloc.0                                             
2372         IL_0007:  ldloc.0                                             
2373         IL_0008:  ldc.i4.0                                            
2374         IL_0009:  cgt                                                 
2375         IL_000b:  ldc.i4.0                                            
2376         IL_000c:  ceq                                                 
2377         IL_000e:  stloc.2                                             
2378         IL_000f:  ldloc.2                                             
2379         IL_0010:  brtrue.s IL_0027                                    
2380
2381         IL_0012:  nop 
2382         IL_0013:  ldloc.0 
2383         IL_0014:  ldc.i4.s 0x7b
2384         IL_0016:  ceq          
2385         IL_0018:  ldc.i4.0     
2386         IL_0019:  ceq          
2387         IL_001b:  stloc.2      
2388         IL_001c:  ldloc.2      
2389         IL_001d:  brtrue.s IL_0023
2390
2391         IL_001f:  ldc.i4.m1 
2392         IL_0020:  stloc.1   
2393         IL_0021:  br.s IL_0032
2394
2395         IL_0023:  ldc.i4.1 
2396         IL_0024:  stloc.1  
2397         IL_0025:  br.s IL_0032
2398
2399         IL_0027:  
2400         IL_002c:  newobj instance void class [mscorlib]System.Exception::'.ctor'()
2401         IL_0031:  throw                                                                            
2402         IL_0032:  ldloc.1                                                                          
2403         IL_0033:  ret                                                                              
2404     }
2405
2406         .method public static hidebysig  specialname 
2407          default int32 test_0_regress_513931 ()  cil managed 
2408         {
2409                 call int32 Tests::regress_513931_inner ()
2410                 pop
2411                 ldc.i4.0
2412                 ret
2413         }
2414
2415         .method public static default int32 test_0_newarr_i8 () cil managed
2416         {
2417                 ldc.i4 1000
2418                 conv.i8
2419                 newarr [mscorlib]System.Boolean
2420                 pop
2421                 ldc.i4 0
2422                 ret
2423         }
2424
2425         .method public static specialname 
2426                default int32 return_1_noinline ()  cil managed noinlining 
2427         {
2428                 .maxstack 0
2429
2430                 ldc.i4.1
2431                 ret 
2432         }
2433
2434         // Only happens with -O=-deadce,cmov
2435         .method public static default int32 test_0_cmov_unused_582322 () cil managed
2436         {
2437         .maxstack 2                                                   
2438         .locals init (                                                
2439                                 int32 V_0
2440                 )                               
2441                 call int32 Tests::return_1_noinline ()
2442                 ldc.i4.1
2443                 bne.un L0
2444                 ldloc.s 0
2445                 pop
2446         L0:
2447                 ldc.i4.0
2448                 ret
2449         }
2450
2451     .method public static  hidebysig 
2452            default int32 test_0_regress_586664 ()  cil managed 
2453     {                                        
2454         // Method begins at RVA 0x20f4       
2455         // Code size 76 (0x4c)               
2456         .maxstack 6                          
2457         .locals init (                       
2458                 float64 V_0,                 
2459                 float64[]       V_1)         
2460         IL_0000:  ldc.r8 1.                  
2461         IL_0009:  ldc.r8 2.                  
2462         IL_0012:  ldc.r8 1.                  
2463         IL_001b:  call float64 class [mscorlib]System.Math::Pow(float64, float64)
2464         IL_0020:  div                                                            
2465         IL_0021:  stloc.0                                                        
2466         IL_0022:  ldc.i4.2                                                       
2467         IL_0023:  newarr [mscorlib]System.Double                                 
2468         IL_0028:  dup                                                            
2469         IL_0029:  ldc.i4.0                                                       
2470         IL_002a:  ldloc.0                                                        
2471         IL_002b:  neg                                                            
2472         IL_002c:  stelem.r8                                                      
2473         IL_002d:  dup                                                            
2474         IL_002e:  ldc.i4.1                                                       
2475         IL_002f:  ldloc.0
2476         IL_0030:  neg
2477         IL_0031:  stelem.r8
2478         IL_0032:  stloc.1
2479         IL_0033:  ldloc.1
2480         IL_0034:  ldc.i4.0
2481         IL_0035:  ldelem.r8
2482         IL_0036:  ldc.r8 -0.5
2483         IL_003f:  bne.un IL_004a
2484
2485         IL_0044:  ldc.i4.0
2486         IL_0045:  br IL_004b
2487
2488         IL_004a:  ldc.i4.1
2489         IL_004b:  ret
2490     }
2491
2492         .method public static int32 test_2_leave_multiple_blocks_from_end ()
2493         {
2494                 .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.
2495                 .locals init (int32 V_0)
2496
2497                 .try {
2498                         .try {
2499                                 nop
2500                                 nop
2501                                 leave END
2502                         } finally {
2503                                 ldloc.0
2504                                 ldc.i4.1
2505                                 add
2506                                 stloc.0
2507                                 endfinally
2508                         }
2509                         nop
2510                         leave END
2511                 } finally {
2512                         ldloc.0
2513                         ldc.i4.1
2514                         add
2515                         stloc.0
2516                         endfinally
2517                 }
2518 END:
2519                 ldloc.0
2520                 ret
2521         }
2522
2523         .method public static int32 test_3_leave_multiple_blocks_from_hole ()
2524         {
2525                 .locals init (int32 V_0)
2526
2527                 .try {
2528                         .try {
2529                                 ldloc.0
2530                                 brtrue REST
2531                                 leave BEFORE_END
2532 REST:
2533                                 nop
2534                                 nop
2535                                 leave END
2536                         } finally {
2537                                 ldloc.0
2538                                 ldc.i4.1
2539                                 add
2540                                 stloc.0
2541                                 endfinally
2542                         }
2543                         nop
2544                         leave END
2545                 } finally {
2546                         ldloc.0
2547                         ldc.i4.1
2548                         add
2549                         stloc.0
2550                         endfinally
2551                 }
2552 BEFORE_END:
2553                 ldloc.0
2554                 ldc.i4.1
2555                 add
2556                 stloc.0
2557 END:
2558                 ldloc.0
2559                 ret
2560         }
2561
2562         .class nested private auto ansi sealed beforefieldinit Pair`2<TKey,TValue>
2563                    extends [mscorlib]System.ValueType
2564         {
2565                 .field  public  !0 key
2566         .field  public  !1 'value'
2567         }
2568
2569     .method private static hidebysig 
2570            default bool ContentEquals<TKey,TValue> (valuetype Tests/Pair`2<!!TKey, !!TValue> v)  cil managed 
2571     {
2572         .maxstack 8
2573         IL_0000:  ldarga.s 0 
2574         IL_0006:  ldnull 
2575                           constrained. valuetype Tests/Pair`2<!!0,!!1>
2576         IL_0007:  callvirt instance bool class [mscorlib]System.Object::Equals(object)
2577                           ret
2578     }
2579
2580     .method public static hidebysig default int32 test_0_constrained_gshared_595863 () cil managed
2581     {
2582                 .locals init (
2583                 valuetype Tests/Pair`2<string, string>  V_0,
2584                 valuetype Tests/Pair`2<string, string>  V_1)
2585         IL_0000:  ldloca.s 0
2586         IL_0002:  initobj valuetype Tests/Pair`2<string,string>
2587         IL_0008:  ldloc.0 
2588         IL_0009:  stloc.1 
2589         IL_000a:  ldloca.s 1
2590         IL_000c:  ldstr "A"
2591         IL_0011:  stfld !0 valuetype Tests/Pair`2<string,string>::key
2592         IL_0016:  ldloca.s 1
2593         IL_0018:  ldstr "B"
2594         IL_001d:  stfld !1 valuetype Tests/Pair`2<string,string>::'value'
2595         IL_0022:  ldloc.1 
2596         IL_0023:  stloc.0 
2597         IL_0024:  ldloc.0 
2598         IL_0025:  call bool class Tests::ContentEquals<string, string> (valuetype Tests/Pair`2<!!0,!!1>)
2599                           brfalse SUCCESS
2600                           ldc.i4.1
2601                           ret
2602         SUCCESS:
2603                           ldc.i4.0
2604                           ret
2605     }
2606
2607         .method public static default int32 test_0_wrap_non_exception_throws () cil managed
2608         {
2609           .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.
2610           .try {
2611                     newobj instance void class [mscorlib]System.Object::'.ctor'()
2612                         throw
2613                   leave IL_0
2614           } catch class [mscorlib]System.Runtime.CompilerServices.RuntimeWrappedException {
2615                   leave IL_0
2616                 }
2617                 IL_0:
2618                 ldc.i4.0
2619                 ret
2620     }
2621
2622         .method public static default int32 test_0_typespec_modopt () cil managed {
2623                 .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.
2624                 ldtoken class Tests modopt (Tests)
2625                 pop
2626                 ldc.i4.0
2627                 ret
2628         }
2629
2630         .method public hidebysig static int32 SizeOfT<T>() cil managed
2631         {
2632                 .maxstack  8
2633     
2634                 sizeof !!0
2635         ret
2636         }
2637
2638         .method public static default int32 test_1_sizeof_gshared () cil managed {
2639                 .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.
2640             call   int32 Tests::SizeOfT<int8>()
2641                 ldc.i4.1
2642                 ceq
2643                 ret
2644         }
2645
2646         .method public static default int32 test_1_sizeof_ref () cil managed {
2647             call   int32 Tests::SizeOfT<object>()
2648                 sizeof [mscorlib]System.IntPtr
2649                 ceq
2650                 ret
2651         }
2652
2653   .field static public int32 volatile_int
2654
2655         .method public static default int32 test_5_volatile_load_store () cil managed {
2656                 ldsflda int32 class Tests::volatile_int
2657                 ldc.i4 5
2658                 volatile.
2659                 stind.i4
2660                 ldsflda int32 class Tests::volatile_int
2661                 volatile.
2662                 ldind.i4
2663                 ret
2664         }               
2665
2666     .method public static 
2667            default int32 regress_693905_inner (int32 x, int32 acc)  cil managed 
2668     {
2669         // Method begins at RVA 0x2050
2670         // Code size 17 (0x11)
2671         .maxstack 5
2672         IL_0000:  ldarg.0 
2673         IL_0001:  brtrue.s IL_0005
2674
2675         IL_0003:  ldarg.1 
2676         IL_0004:  ret 
2677         IL_0005:  ldarg.0 
2678         IL_0006:  ldc.i4.1 
2679         IL_0007:  sub 
2680         IL_0008:  ldarg.1 
2681         IL_0009:  ldc.i4.1 
2682         IL_000a:  add 
2683         IL_000b:  starg.s 1
2684         IL_000d:  starg.s 0
2685         IL_000f:  br.s IL_0000
2686
2687     } // end of method Test::f
2688
2689     .method public static 
2690            default int32 test_10_regress_693905 ()  cil managed 
2691         {
2692                 ldc.i4.s 0x0a
2693         ldc.i4.0 
2694         call int32 class Tests::regress_693905_inner(int32, int32)
2695                 ret
2696         }
2697
2698         .method public static
2699                         default int32 test_0_llvm_regress_171 () cil managed
2700         {
2701                 .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.
2702                 .locals init (
2703                         int32 i
2704                 )
2705
2706                 call int32 Tests::return_1_noinline ()
2707                 ldc.i4.1
2708                 beq L1
2709                 ldc.i4.1
2710                 stloc.s 0
2711                 call int32 Tests::return_1_noinline ()
2712                 ldc.i4.0
2713                 beq L1
2714                 L1:
2715                 ldloc.s 0
2716                 ret
2717         }
2718
2719      .field  public static int32 static_a
2720
2721         .method public static
2722                         default int32 test_4_ldfld_stfld_static () cil managed
2723         {
2724                 .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.
2725                 ldnull
2726                 ldc.i4 2
2727                 stfld int32 Tests::static_a
2728                 ldnull
2729                 ldfld int32 Tests::static_a
2730                 ldnull
2731                 ldflda int32 Tests::static_a
2732                 ldind.i4
2733                 add
2734                 ret
2735         }
2736
2737   .method public static default int32 no_initlocals_inner () cil managed
2738   {
2739     .locals (
2740         int32 V_0,
2741         float32 V_1,
2742         float64 V_2,
2743         valuetype Tests/TailCallStruct V_3)
2744        ldloc V_0
2745        ret
2746   }
2747
2748   .method public static default int32 test_0_no_initlocals () cil managed
2749   {
2750        call int32 Tests::no_initlocals_inner()
2751        pop
2752            ldc.i4.0
2753        ret
2754   }
2755
2756   .method public hidebysig static int32  test_5_r4_fadd_mixed() cil managed
2757   {
2758     // Code size       17 (0x11)
2759     .maxstack  2
2760     .locals init (float32 V_0,
2761              float64 V_1)
2762     IL_0000:  ldc.r4     3
2763     IL_0005:  stloc.0
2764     IL_0006:  ldc.r8     2
2765     IL_000b:  stloc.1
2766     IL_000c:  ldloc.0
2767     IL_000d:  ldloc.1
2768     IL_000e:  add
2769     IL_000f:  conv.i4
2770     IL_0010:  ret
2771   }
2772
2773  .method public hidebysig static int32  test_0_fcmp_eq_r4_mixed() cil managed
2774   {
2775     // Code size       32 (0x20)
2776     .maxstack  2
2777     .locals init (float32 V_0,
2778              float64 V_1)
2779     IL_0000:  ldc.r4     1
2780     IL_0005:  stloc.0
2781     IL_0006:  ldc.r8     1
2782     IL_000f:  stloc.1
2783     IL_0010:  ldloc.0
2784     IL_0012:  ldloc.1
2785     IL_0013:  bne.un     IL_001e
2786
2787     IL_0018:  ldc.i4.0
2788     IL_0019:  br         IL_001f
2789
2790     IL_001e:  ldc.i4.1
2791     IL_001f:  ret
2792   } // end of method Tests::test_0_fcmp_eq_r4_mixed
2793
2794   .method public hidebysig static int32  test_0_fceq_r4_mixed() cil managed
2795   {
2796     // Code size       31 (0x1f)
2797     .maxstack  2
2798     .locals init (float32 V_0,
2799              float64 V_1,
2800              bool V_2)
2801     IL_0000:  ldc.r4     1
2802     IL_0005:  stloc.0
2803     IL_0006:  ldc.r8     1
2804     IL_000b:  stloc.1
2805     IL_000c:  ldloc.0
2806     IL_000d:  ldloc.1
2807     IL_000e:  ceq
2808     IL_0010:  stloc.2
2809     IL_0011:  ldloc.2
2810     IL_0012:  brfalse    IL_001d
2811
2812     IL_0017:  ldc.i4.0
2813     IL_0018:  br         IL_001e
2814
2815     IL_001d:  ldc.i4.1
2816     IL_001e:  ret
2817   } // end of method Tests::test_0_fceq_r4
2818
2819   .method public static int32 test_0_switch_loop () cil managed
2820   {
2821         .maxstack 16
2822         .locals init (valuetype Tests/TailCallStruct V_0, int32 V_1)
2823         ldc.i4.0
2824         ldloc.0
2825         ldloc.1
2826         brtrue L_1
2827         L_0:
2828         ldc.i4.4
2829         switch (L_0)
2830         L_1:
2831         pop
2832         ret
2833   }
2834 }