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