[wasm] Improve virtualenv installation script (#18470)
[mono-project.git] / mono / mini / iltests.il
blobe361af3eed797f1d688af54fa4359460ed513184
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.
6 .assembly extern TestDriver {}
7 .assembly extern mscorlib {}
9   .class private sequential ansi sealed beforefieldinit FLSharedKeys
10   extends [mscorlib]System.ValueType
11   {
12          .pack 0
13          .size 1
14   }
16 .class public auto ansi sealed beforefieldinit Tests {
18         .method static public int32 Main(string[] args) il managed {
19                 .entrypoint
20                 
21                 ldtoken Tests
22                 call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
23                 ldarg.0
24                 call       int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type, string[])
25                 ret
26         }
28         .method hidebysig static int32 comp_ptr_i8(void* arg, int64 v) cil managed
29         {
30                 .maxstack 2
32                 ldarg.0
33                 ldarg.1
34                 ceq
35                 ret
36         }
38         .method hidebysig static int64 add_ptr_i4(void* arg) cil managed
39         {
40                 .maxstack 2
42                 ldarg.0
43                 ldc.i4.2
44                 add
45                 ret
46         }
48         .method hidebysig static int64 add_ptr_i8(void* arg, int64 v) cil managed
49         {
50                 .maxstack 2
52                 ldarg.0
53                 ldarg.1
54                 add
55                 ret
56         }
58         .method hidebysig static int64 and_ptr_i8(void* arg, int64 v) cil managed
59         {
60                 .maxstack 2
62                 ldarg.0
63                 ldarg.1
64                 and
65                 ret
66         }
68         .method hidebysig static int32 i8_ptr_arithm_x64() cil managed
69         {
70                 .maxstack 3
72                 ldc.i4.1
73                 ldc.i8 0x1111222233334444
74                 call int64 class Tests::add_ptr_i4(void*)
75                 ldc.i8 0x1111222233334446
76                 bne.un FAIL1
77                 pop
79                 ldc.i4.2
80                 ldc.i8 0x1111222233334444
81                 ldc.i8 0x2
82                 call int64 class Tests::add_ptr_i8(void*,int64)
83                 ldc.i8 0x1111222233334446
84                 bne.un FAIL1
85                 pop
87                 ldc.i4.3
88                 ldc.i8 0x1111222233334444
89                 ldc.i4 0x2
90                 call int64 class Tests::add_ptr_i8(void*,int64)
91                 ldc.i8 0x1111222233334446
92                 bne.un FAIL1
93                 pop
95                 ldc.i4.4
96                 ldc.i8 0x1111222233334444
97                 ldc.i8 0x0000FFFF00000000
98                 call int64 class Tests::and_ptr_i8(void*,int64)
99                 ldc.i8 0x0000222200000000
100                 bne.un FAIL1
101                 pop
103                 ldc.i4.5
104                 ldc.i8 0x1111222233334444
105                 ldc.i4 0xFFFF0000
106                 call int64 class Tests::and_ptr_i8(void*,int64)
107                 ldc.i8 0x1111222233330000
108                 bne.un FAIL1
109                 pop
111                 ldc.i4.6
112                 ldc.i8 0x1111222233334444
113                 ldc.i4 0xFFFF0000
114                 and
115                 ldc.i8 0x1111222233330000
116                 bne.un FAIL1
117                 pop
119                 ldc.i4.7
120                 ldc.i8 0x1111222233334444
121                 ldc.i8 0x1111222233334444
122                 call int32 class Tests::comp_ptr_i8(void*,int64)
123                 ldc.i4.1
124                 bne.un FAIL1
125                 pop
127                 ldc.i4.8
128                 ldc.i8 0x1111222233334444
129                 ldc.i4 0x1111
130                 add
131                 ldc.i8 0x1111222233335555
132                 bne.un FAIL1
133                 pop
135                 ldc.i4.0
136 FAIL1:
137                 ret
138         }
140         .method static public int32 test_0_i8_ptr_arithm() cil managed {
141                 .maxstack 2
143                 sizeof [mscorlib]System.IntPtr
144                 ldc.i4.8
145                 bne.un OK1
146                 call int32 class Tests::i8_ptr_arithm_x64()
147                 ret
149 OK1:
150                 ldc.i4.0
151                 ret
152         }
154         // make sure the register allocator works when the return value of
155         // 'div' is discarded
156         .method static public int32 test_0_div_regalloc () il managed {
157                 .locals init (
158                         int32 i
159                 )
161                 ldloc 0
162                 ldc.i4.s 0xa
163                 div
164                 pop
165                 ldc.i4.0
166                 ret
167         }
168         
169         
170         .method static public int32 test_1_ceq_to_i4 () il managed {
171                 .locals init (
172                         int32   foo
173                 )
174                 ldc.i4 500
175                 stloc foo
176                 ldloc foo
177                 ldc.i4 500
178                 ceq
179                 stloc foo
180                 ldloc foo
181                 ret
182         }
183         
184         .method static public int32 test_3_shl_regvars () il managed {
185                 .locals init (
186                         int32   a,
187                         int32   b,
188                         int32   r1,
189                         int32   r2,
190                         int32   r3
191                 )
192                         
193                 ldc.i4.2
194                 stloc      a
195                 ldc.i4.1
196                 stloc      b
197         
198                 ldloc      a
199                 ldloc      b
200                 shl 
201                 stloc      r1
202                 
203                 ldloc      a
204                 ldloc      b
205                 shl 
206                 stloc      r2
207                 
208                 ldloc      a
209                 ldloc      b
210                 shl 
211                 stloc      r3
212                 
213                 ldloc      r1
214                 ldc.i4.4
215                 ceq
216                 
217                 ldloc      r2
218                 ldc.i4.4
219                 ceq
220                 
221                 ldloc      r3
222                 ldc.i4.4
223                 ceq
224                 
225                 add
226                 add
227                 
228                 ret
229         }
230         
231         .method static public int32 test_1_fceq_to_i4 () il managed {
232         
233                 .locals init (
234                         float64 foo,
235                         int32   val
236                 )
238                 ldc.r8      2
239                 stloc       foo
240                 
241                 ldloc       foo
242                 ldc.r8      2
243                 ceq
244                 stloc       val
245                 
246                 ldloc       val
247                 ret
248         }
250         //
251         // This should be manually checked. Basically under -O=linears,
252         // you should not see tons of register spilling.
253         //
254         .method static public int32 test_1_bytedreg_free () il managed {
255                 .locals init (
256                         int32   foo
257                 )
258                 ldc.i4 500
259                 stloc foo
260                 ldloc foo
261                 ldc.i4 500
262                 ceq
263                 stloc foo
264                 
265                 ldloc foo
266                 ldc.i4 1
267                 ceq
268                 stloc foo
270                 ldloc foo
271                 ldc.i4 1
272                 ceq
273                 stloc foo
275                 ldloc foo
276                 ldc.i4 1
277                 ceq
278                 stloc foo
279                 
280                 ldloc foo
281                 ldc.i4 1
282                 ceq
283                 stloc foo
284                 
285                 ldloc foo
286                 ret
287         }
288         
289         //
290         // This should be manually checked. Basically under -O=linears,
291         // you should not see tons of register spilling.
292         //
293         .method static public int32 test_0_bytesreg1_free () il managed {
294                 .locals init (
295                         unsigned int8      dest,
296                         int32              src,
297                         unsigned int8&     pdest
298                 )
300                 ldloca     dest
301                 stloc      pdest
302                 
303                 ldloc      pdest
304                 ldloc      src
305                 stind.i1
306                 
307                 ldloc      pdest
308                 ldloc      src
309                 stind.i1
310                 
311                 ldloc      pdest
312                 ldloc      src
313                 stind.i1
314                 
315                 ldloc      pdest
316                 ldloc      src
317                 stind.i1
318                 
319                 ldloc      pdest
320                 ldloc      src
321                 stind.i1
322                 
323                 ldloc      pdest
324                 ldloc      src
325                 stind.i1
326                 
327                 ldloc      pdest
328                 ldind.i1
329                 ret
330         }
331         
332         .method static public int32 test_1_shift_regvar () il managed {
333         
334                 .locals init (
335                         int32   v7FFFFFFF,
336                         int32   v1
337                 )
338                 
339                 ldc.i4  0x7FFFFFFF
340                 stloc   v7FFFFFFF
341         
342                 ldc.i4.1
343                 stloc v1
344                 
345                 ldloc   v7FFFFFFF
346                 ldloc   v1
347                 shl
348                 ldc.i4  0xFFFFFFFE
349                 ceq
350                 ret
351         }
352         
353         // this only happens with the managed pointer, not an unmanaged one.
354         .method static public int32 test_0_foo () il managed {
355         
356                 .locals init (
357                         int32&  buf
358                 )
359                 
360                 ldc.i4.5
361                 localloc
362                 
363                 stloc buf
364                 ldloc buf
365                 
366                 ldind.i4
367                 
368                 ret
369         }
371         .method static public int32 test_0_localloc () cil managed {
372                 .locals init (native int, native int, native int, native int, int32)
374                 ldc.i4 6
375                 localloc
376                 conv.i
377                 stloc.0
379                 ldc.i4 6
380                 localloc
381                 conv.i
382                 stloc.1
384                 ldc.i4 6
385                 localloc
386                 conv.i
387                 stloc.2
389                 // Variable length
390                 ldc.i4 128
391                 stloc.s 4
392                 ldloc.s 4
393                 localloc
394                 conv.i
395                 stloc.3
397                 // Check zero initialized
398                 ldloc.0
399                 ldind.i4
400                 ldc.i4.0
401                 beq OK1
402                 ldc.i4.1
403                 br FAIL
405 OK1:
406                 ldloc.3
407                 ldind.i4
408                 ldc.i4.0
409                 beq OK2
410                 ldc.i4.2
411                 br FAIL
413 OK2:
414                 ldloc.3
415                 ldc.i4.s 124
416                 add
417                 ldind.i4
418                 ldc.i4.0
419                 beq OK3
420                 ldc.i4.3
421                 br FAIL
423 OK3:
424                 ldloc.1
425                 ldc.i4 999999
426                 stind.i4
427                 ldloc.1
428                 ldind.i4
429                 ldc.i4 999999
430                 beq OK4
431                 ldc.i4.4
432                 br FAIL
434 OK4:
435                 ldloc.0
436                 ldc.i4 999999
437                 stind.i4
438                 ldloc.0
439                 ldind.i4
440                 ldc.i4 999999
441                 beq OK5
442                 ldc.i4.5
443                 br FAIL
445 OK5:
446                 // Try allocations bigger than one page
447                 ldc.i4 8196
448                 localloc
449                 conv.i
450                 stloc.3
451                 ldloc.3
452                 ldc.i4 8192
453                 add
454                 ldc.i4 99
455                 stind.i4
456                 ldloc.3
457                 ldc.i4 8192
458                 add
459                 ldind.i4
460                 ldc.i4 99
461                 beq PASS
462                 ldc.i4.6
463                 br FAIL
465 FAIL:
466                 ret
468 PASS:   ldc.i4.0
469                 ret
470         }
472     .method private static void do_localloc () cil managed {
473         .maxstack 3
474         .locals init (
475                 unsigned int8*  V_0)
476         IL_0000:  ldc.i4.1
477         IL_0001:  ldc.i4 131072
478         IL_0006:  mul
479         IL_0007:  localloc
480         IL_0009:  stloc.0
481         IL_000a:  ret
482     }
484         // Check that localloc cannot be inlined
485         .method static public int32 test_0_localloc_inline () cil managed {
486                 .maxstack 16
487                 .locals init (
488                         int32 i
489                 )
491                 ldc.i4.0
492         stloc.0
493         br COND
495 START:  call void class Tests::do_localloc()
496         ldloc.0
497         ldc.i4.1
498         add
499         stloc.0
500 COND:   ldloc.0
501         ldc.i4 1000
502         blt START
504                 ldc.i4.0
505                 ret
506         }       
507         
508         .method static public int32 test_3_copy_used_bug () il managed {
510                 .locals init (
511                         int32 size,
512                         int32 res
513                 )
515                 ldc.i4 0
516                 stloc res
518                 ldc.i4 1
519                 stloc size
521                 ldloc size
522                 ldloc size
523                 ldloc size
524                 add
525                 stloc size
526                 ldloc size
527                 add
528                 stloc res
530                 ldloc res
531                 ret
532         }
534         // demonstrate that the copy_used_var is not a fix for the above bug
535         .method static public int32 test_3_copy_used_indir_bug () il managed {
537                 .locals init (
538                         int32 size,
539                         int32 res
540                 )
542                 ldc.i4 0
543                 stloc res
545                 ldc.i4 1
546                 stloc size
548                 ldloc size
549                 ldloca size
550                 ldloc size
551                 ldloc size
552                 add
553                 stind.i4
554                 ldloc size
555                 add
556                 stloc res
558                 ldloc res
559                 ret
560         }
562         .method static public void do_nothing (int32 a) il managed {
563                 ret
564         }
565         
566         // demonstrate the block_split failure: needs -O=inline
567         // mini -O=inline --compile Tests:test_0_split_block_bug iltests.exe
568         .method static public int32 test_0_split_block_bug () il managed {
570                 .locals init (
571                         int32 i1
572                 )
574                 ldc.i4 1
575                 stloc i1
576  test_label:
577                 ldloc i1
578                 call void class Tests::do_nothing (int32)
579                 ldc.i4 0
580                 brtrue test_label
581                 
582                 ldc.i4 0
583                 ret
584         }
586         .method public void inline_do_nothing () il managed {
587                 ret
588         }
589         .method static public int32 test_1_checkthis_inlining () il managed {
590                 ldnull
591                 call instance void class Tests::inline_do_nothing ()
592                 ldc.i4 1
593                 ret
594         }
596         .class nested private auto ansi sealed beforefieldinit TailCallStruct 
597                 extends [mscorlib]System.ValueType {
598                 .field public int32 a
599                 .field public int32 b
600         }
602         .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
603                 ldarga 0
604                 ldarga 0
605                 ldfld int32 Tests/TailCallStruct::a
606                 ldc.i4.1
607                 add
608                 stfld int32 Tests/TailCallStruct::a
609                 ldarga 0
610                 ldarga 0
611                 ldfld int32 Tests/TailCallStruct::a
612                 ldc.i4.2
613                 add
614                 stfld int32 Tests/TailCallStruct::a
615                 ldarg.0
616                 ret
617         }
619         .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
620                 ldarg.0
621                 tail.
622                 call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
623                 ret
624         }
626         .class nested private auto ansi sealed beforefieldinit TailCallStructBig
627                 extends [mscorlib]System.ValueType {
628                 .field public int32 a
629                 .field public int32 b
630                 .field public int32 c
631                 .field public int32 d
632                 .field public int32 e
633         }
635         .method static valuetype Tests/TailCallStructBig tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig arg) {
636                 ldarga 0
637                 ldarga 0
638                 ldfld int32 Tests/TailCallStructBig::a
639                 ldc.i4.1
640                 add
641                 stfld int32 Tests/TailCallStructBig::a
642                 ldarg.0
643                 ret
644         }
646         .method static valuetype Tests/TailCallStructBig tail_vret_by_addr (valuetype Tests/TailCallStructBig arg) {
647                 ldarg.0
648                 tail.
649                 call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig)
650                 ret
651         }
653         .method static public int32 test_3_tail_call_vret_by_addr () il managed {
654                 .maxstack 16
655                 .locals init (
656                         valuetype Tests/TailCallStructBig arg2
657                 )
659                 ldloca 0
660                 ldc.i4.2
661                 stfld int32 Tests/TailCallStructBig::a
662                 ldloc.0
663                 call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr (valuetype Tests/TailCallStructBig)
664                 stloc.0
666                 ldloca 0
667                 ldfld int32 Tests/TailCallStructBig::a
668                 ret
669         }
671         .method static public int32 test_9_tail_call_vret_by_val () il managed {
672                 .maxstack 16
673                 .locals init (
674                         valuetype Tests/TailCallStruct arg
675                 )
676                 ldloca 0
677                 ldc.i4.2
678                 stfld int32 Tests/TailCallStruct::a
679                 ldloca 0
680                 ldc.i4.4
681                 stfld int32 Tests/TailCallStruct::b
682                 ldloc.0
683                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
684                 stloc.0
686                 ldloca 0
687                 ldfld int32 Tests/TailCallStruct::a
688                 ldloca 0
689                 ldfld int32 Tests/TailCallStruct::b
690                 add
691                 ret
692         }
694         .method static public int32 tail3 (int32 i, int32 j) il managed {
695                 ldarg.0
696                 ldarg.1
697                 add
698                 ret
699         }
701         .method static public int32 tail4 (int32 i, int32 j) il managed {
702                 .maxstack 16
703                 .locals init (
704                         int32 k)
706                 // Test arg0 allocated to a register
707                 ldarg.0
708                 ldarg.0
709                 ldarg.0
710                 ldarg.0
711                 add
712                 add
713                 add
714                 starg 0
716                 // Test switched up argument variables as the actual arguments
717                 ldarg.1
718                 ldarg.0
719                 tail.
720                 call int32 Tests::tail3 (int32, int32)
721                 ret
722         }
724         .method static public int32 test_24_tail_calls2 () il managed {
725                 // Some platforms might not be able to AOT tail calls
726                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
728                 .maxstack 16
729                 .locals init (
730                         int32 i,
731                         int32 j)
733                 ldc.i4.4
734                 stloc.0
735                 ldc.i4.8
736                 stloc.1
738                 ldloc.0 
739                 ldloc.1
740                 call int32 Tests::tail4 (int32, int32)
741                 ret
742         }
744         .method public static int32 test_5_jmp () cil managed {
745                 // Some platforms might not be able to AOT tail calls
746                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
748                 ldc.i4.1
749                 ldc.i4.2
750                 call int32 Tests::jmp2 (int32, int32)
751                 ret
752         }
754         .method public static int32 jmp2 (int32, int32) cil managed {
755                 ldarg.0
756                 ldc.i4.1
757                 add
758                 starg.s 0
759                 ldarg.1
760                 ldc.i4.1
761                 add
762                 starg.s 1
763                 jmp int32 Tests::jmp3 (int32, int32)
764                 ldc.i4.0
765                 ret
766         }               
768         .method public static int32 jmp3 (int32 i, int32 j) cil managed {
769                 ldarg.0
770                 ldarg.1
771                 add
772                 ret
773         }
775         .method static public int32 test_11_switch_with_nonempty_stack () il managed {
776                 .maxstack 16
778                 ldc.i4.5
779                 ldc.i4.6
780                 ldc.i4.1
781                 switch (L0, L1)
782         L0: 
783                 add
784                 ret
785         L1:
786                 add
787                 ret
788         }
790     .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
791                 .maxstack 16
793         .try {
794           leave IL_0
795         }
796         finally  {
797           ldc.i4.0
798           endfinally
799         }
800         IL_0:  ldc.i4.5
801                 ret
802     }
804     .method public static int32 test_5_endfinally_llvm_linking () il managed {
805                 .maxstack 16
807         .try {
808           leave IL_0
809         }
810         finally  {
811           ldc.i4.0
812                   dup
813                   brtrue L1
814                   pop
815                   br L2
816                 L1:
817                   pop
818                 L2:
819           endfinally
820         }
821         IL_0:  ldc.i4.5
822                 ret
823     }
825         .method public static int32 test_0_conv_ovf_i8_neg () il managed {
826                 .maxstack 16
828                 ldc.i4.m1
829                 conv.ovf.i8
830                 conv.i4
831                 ldc.i4.m1
832                 beq L_OK
833                 ldc.i4.1
834                 ret
835         L_OK:
836                 ldc.i4.0
837                 ret
838         }               
840         .method public static int32 test_1234_conv_u4 () cil managed {
841                 .maxstack 16
843                 ldc.i4 1234
844                 conv.u4
845                 conv.i4
846                 ret
847         }
849         .method public static int32 test_0_conv_ovf_i_un () cil managed {
850                 .maxstack 16
852                 ldc.i4 1234
853                 conv.ovf.i.un
854                 conv.i4
855                 ldc.i4 1234
856                 beq L1
857                 ldc.i4.1
858                 ret
859         L1:
860                 ldc.i4 0x7fffffff
861                 conv.ovf.i.un
862                 conv.i4
863                 ldc.i4 0x7fffffff
864                 beq L2
865                 ldc.i4.2
866                 ret
867         L2:
868                 sizeof [mscorlib]System.IntPtr
869                 ldc.i4 8
870                 beq L5
871                 .try {
872                         ldc.i4 0x80000000
873                         conv.ovf.i.un
874                         leave L4
875                 } catch [mscorlib]System.OverflowException {
876                         pop
877                         leave L5
878                 }
879         L4: 
880                 ldc.i4.3
881                 ret
882         L5:
883                 ldc.i4.0
884                 ret
885         }
887         .method public static int32 test_0_conv_ovf_u_un () cil managed {
888                 .maxstack 16
890                 ldc.i4 1234
891                 conv.ovf.u.un
892                 conv.i4
893                 ldc.i4 1234
894                 beq L1
895                 ldc.i4.1
896                 ret
897         L1:
898                 ldc.i4.0
899                 ret
900         }
902         .method public static int32 test_0_conv_ovf_i () cil managed {
903                 .maxstack 16
905                 ldc.i4 1234
906                 conv.ovf.i
907                 conv.i4
908                 ldc.i4 1234
909                 beq L1
910                 ldc.i4.1
911                 ret
912         L1:
913                 ldc.i4.0
914                 ret
915         }
917         .method public static int32 test_0_conv_ovf_u () cil managed {
918                 .maxstack 16
920                 ldc.i4 1234
921                 conv.ovf.u
922                 conv.i4
923                 ldc.i4 1234
924                 beq L1
925                 ldc.i4.1
926                 ret
927         L1:
928                 ldc.i4.0
929                 ret
930         }
932         .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
933                 .maxstack 16
935                 ldc.i4 1234
936                 conv.ovf.i8.un
937                 conv.i4
938                 ret
939         }
941         .method public static int32 test_0_lconv_ovf_i () cil managed {
942                 .maxstack 16
944                 ldc.i4 1234
945                 conv.i8
946                 conv.ovf.i
947                 conv.i4
948                 ldc.i4 1234
949                 beq L1
950                 ldc.i4.1
951                 ret
952         L1:
953                 ldc.i4.0
954                 ret
955         }
957         .method public static int32 test_0_lconv_ovf_u () cil managed {
958                 .maxstack 16
960                 ldc.i4 1234
961                 conv.i8
962                 conv.ovf.u
963                 conv.i4
964                 ldc.i4 1234
965                 beq L1
966                 ldc.i4.1
967                 ret
968         L1:
969                 ldc.i4.0
970                 ret
971         }
973         .method public static int32 test_0_lconv_ovf_i_un () cil managed {
974                 .maxstack 16
976                 ldc.i4 1234
977                 conv.i8
978                 conv.ovf.i.un
979                 conv.i4
980                 ldc.i4 1234
981                 beq L1
982                 ldc.i4.1
983                 ret
984         L1:
985                 ldc.i4.0
986                 ret
987         }
989         .method public static int32 test_0_lconv_ovf_u_un () cil managed {
990                 .maxstack 16
992                 ldc.i4 1234
993                 conv.i8
994                 conv.ovf.u.un
995                 conv.i4
996                 ldc.i4 1234
997                 beq L1
998                 ldc.i4.1
999                 ret
1000         L1:
1001                 ldc.i4.0
1002                 ret
1003         }
1005         .method public static int32 test_0_lconv_to_ovf_i8 () cil managed {
1006                 .maxstack 16
1008                 ldc.i4 1234
1009                 conv.i8
1010                 conv.ovf.i8
1011                 conv.i4
1012                 ldc.i4 1234
1013                 beq L1
1014                 ldc.i4.1
1015                 ret
1016         L1:
1017                 ldc.i4.0
1018                 ret
1019         }
1021         .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
1022                 .maxstack 16
1024                 ldc.i4 1234
1025                 conv.i8
1026                 conv.ovf.u8.un
1027                 conv.i4
1028                 ldc.i4 1234
1029                 beq L1
1030                 ldc.i4.1
1031                 ret
1032         L1:
1033                 ldc.i4.0
1034                 ret
1035         }
1037         .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
1038                 .maxstack 16
1039                 .locals init (int32 res)
1041                 ldc.i4 0x7fffffff
1042                 conv.u8
1043                 conv.ovf.i4.un
1044                 pop
1046                 ldc.i4.2
1047                 stloc res
1049         .try {
1050                         ldc.i8 0x80000000
1051                         conv.ovf.i4.un
1052                         pop
1053                         ldc.i4.0
1054                         stloc res
1055                         leave RET
1056                 } catch [mscorlib]System.OverflowException {
1057                         pop
1058                         leave IL_0
1059                 }
1061         IL_0:
1063         .try {
1064                         ldc.i8 0xffffffff80000000
1065                         conv.ovf.i4.un
1066                         pop
1067                         ldc.i4.1
1068                         stloc res
1069                         leave RET
1070                 } catch [mscorlib]System.OverflowException {
1071                         pop
1072                         leave RET
1073                 }
1075         RET:
1076                 ldloc res
1077                 ret
1078         }
1080     .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
1081                 .maxstack 16
1082                 .locals init (int32 res)
1084                 ldc.i4 0x7fffffff
1085                 conv.u8
1086                 conv.ovf.i.un
1087                 conv.i4
1088                 pop
1090                 ldc.i4.1
1091                 ret
1092         }
1094         .method public static int32 test_32_lconv_to_u8 () cil managed
1095         {
1096                 .maxstack 16
1098                 ldc.i4 32
1099                 conv.i8
1100                 conv.u8
1101                 conv.i4
1102                 ret
1103         }                               
1105         .method public static int32 test_32_lconv_to_i8 () cil managed
1106         {
1107                 .maxstack 16
1109                 ldc.i4 32
1110                 conv.i8
1111                 conv.i8
1112                 conv.i4
1113                 ret
1114         }                               
1116         .method public static int32 test_15_lconv_to_u () cil managed
1117         {
1118         ldc.i8 0x10000000f
1119                 conv.u
1120                 conv.i4
1121                 ret
1122         }
1124         .method public static int32 test_1234_fconv_u () cil managed {
1125                 .maxstack 16
1127                 ldc.r8 1234.0
1128                 conv.u
1129                 conv.i4
1130                 ret
1131         }
1133         .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
1134         {
1135                 .maxstack 16
1136         
1137                 ldc.i4.1
1138                 brfalse OBJECT
1139         
1140                 ldtoken [mscorlib]System.String
1141                 br AFTER
1142         OBJECT:
1143                 ldtoken [mscorlib]System.Object
1144         AFTER:
1145                 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
1146                 callvirt instance string class [mscorlib]System.Type::get_FullName ()
1147                 ldstr "System.String"
1148                 callvirt instance bool class [mscorlib]System.Object::Equals(object)
1149                 ldc.i4.0
1150                 ceq
1151                 ret 
1152         }
1153                 
1154         .method public static int32 test_0_bug59580  ()
1155         {
1156                 ldc.r4          float32(0x7FC00000)
1157                 ldc.r4          float32(0x7FC00000)
1158                 bge.un          pass
1159                 br              fail
1160         pass:
1161                 ldc.i4.0
1162                 ret
1163         fail:
1164                 ldc.i4.1
1165                 ret
1166         }
1167         
1168         .method public static int32 test_1_bug60056  () {
1169                 .locals init (int32 m5)
1170                         
1171                 ldc.i4.m1
1172                 stloc.0
1173                 
1174                 ldc.i4.1
1175                 conv.u8
1176                 
1177                 ldloc.0
1178                 conv.i8
1179                 mul
1180                 
1181                 ldc.i4.m1
1182                 conv.i8
1183                 ceq
1184                 ret
1185         }
1186         
1187         .method public static int32 test_1_conv_u8_cfold  () {
1188                 ldc.i4.m1
1189                 conv.u8
1190                 
1191                 ldc.i8 0x00000000ffffffff
1192                 
1193                 ceq
1194                 ret
1195         }
1196         
1197         .method public static int32 test_1_array_type_mismatch_ldelema  () {
1198                 .locals init (int32 r)
1199                 
1200                         ldc.i4.1
1201                         newarr string
1202                         ldc.i4.0 
1203                         ldelema string
1204                         pop
1205                 
1206                 .try {
1207                         ldc.i4.1
1208                         newarr string
1209                         ldc.i4.0 
1210                         ldelema object
1211                         pop
1212                         
1213                         leave end
1214                 } catch [mscorlib]System.ArrayTypeMismatchException {
1215                         pop
1216                         ldc.i4.1
1217                         stloc.0
1218                         leave end
1219                 }
1220         end:
1221                 ldloc.0
1222                 ret
1223         }
1225         .method public static int32 test_1_conv_ovf_i8_with_i4 () {
1226                         ldc.i4.m1 
1227                         conv.ovf.i8
1228                         conv.ovf.i4
1229                         neg
1230                         ret
1231         }
1233         // bug #72148
1234     .method public static int32 test_0_initlocals_float_ptr () {
1235         .maxstack 3
1236         .locals init (
1237                 float32[]       V_0,
1238                 float32& pinned V_1,
1239                 unsigned int32  V_2)
1240                         ldc.i4.s 0x0f
1241                         newarr [mscorlib]System.Single
1242                         stloc.0 
1243                         ldloc.0 
1244                         ldc.i4.0 
1245                         ldc.r4 1.13
1246                         stelem.r4 
1247                         ldloc.0 
1248                         ldc.i4.0 
1249                         ldelema [mscorlib]System.Single
1250                         stloc.1 
1251                         ldloc.1 
1252                         conv.i 
1253                         ldind.u4 
1254                         stloc.2 
1255                         ldc.i4.0
1256                         ret
1257         }
1259         .method public static int32 test_7_conv_ovf_u8_un () {
1260         .maxstack  2
1261         .locals    init (unsigned int64)
1263         ldc.i4.7
1264         conv.ovf.u8.un
1265         stloc.0
1266                 ldloc.0
1267                 conv.i4
1268         ret
1269         }
1271         .method public static int32 test_7_conv_ovf_u4_un () {
1272         .maxstack  2
1273         .locals    init (unsigned int32)
1275         ldc.i4.7
1276         conv.ovf.u4.un
1277         stloc.0
1278                 ldloc.0
1279                 conv.i4
1280         ret
1281         }
1283         .method public static int32 test_1_bug_74591 () {
1284                 .maxstack 16
1285                 .locals init (int32)
1287                 ldc.i4.m1
1288                 stloc.0
1289                 ldloc.0
1290                 conv.ovf.i8
1291                 ldc.i4.m1
1292                 conv.ovf.i8
1293                 mul.ovf
1294                 conv.i4
1295                 ret
1296         }
1298         .class nested public auto ansi Integer
1299                 extends [mscorlib]System.Object {
1301                 .field public bool n
1303             .method public hidebysig  specialname  rtspecialname 
1304            instance default void .ctor (unsigned int64 i, bool n)  cil managed 
1305             {
1306                         .maxstack 8
1307                         ldarg.0
1308                         call instance void class [mscorlib]System.Object::.ctor()
1309                         ldarg.0
1310                         ldarg.2
1311                         stfld bool Tests/Integer::n
1312                         ret
1313                 }
1314         }
1316         .method public static int32 test_1_bug_74726 () {
1317                 .maxstack 16
1319                 ldc.i4.2
1320                 conv.ovf.u8
1321                 ldc.i4.1
1322                 conv.ovf.u8
1323                 mul.ovf.un
1324                 ldc.i4.1
1325                 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
1326                 ldfld bool Tests/Integer::n
1327                 ldc.i4.1
1328                 ceq
1329                 ret
1330         }
1332         .class nested private auto ansi sealed xxx
1333         extends [mscorlib]System.ValueType
1334    {
1335      .field  public   object a
1337      .method public hidebysig  specialname  rtspecialname 
1338             instance default void .ctor ()  cil managed 
1339      {
1340                  .maxstack 8
1341                  ret 
1342      }
1343    } // end of class xxx
1345         .method public static int32 test_0_newobj_vtype () {
1346                 .maxstack 6
1347                 .locals init (
1348                         valuetype Tests/xxx V_0
1349                 )
1351                 newobj instance void valuetype Tests/xxx::.ctor ()
1352                 stloc.0
1353                 ldloca.s 0
1354                 ldfld object Tests/xxx::a
1355                 brfalse OK
1356                 ldc.i4.s 1
1357                 ret
1358         OK:
1359                 ldc.i4.s 0
1360                 ret
1361         }
1363         .method public static int32 test_0_newobj_vtype_primitive () {
1364                 .maxstack 6
1365                 .locals init (
1366                         native int V_0
1367                 )
1369                 ldc.i4.s 10
1370                 newobj instance void native int::'.ctor'(int32)
1371                 stloc.0
1372                 ldloc.0
1373                 ldc.i4.s 10
1374                 beq OK
1375                 ldc.i4.s 1
1376                 ret
1377         OK:
1378                 ldc.i4.s 0
1379                 ret
1380         }
1382         .method public static int32 test_1_filters () {
1383                 .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 08 21 42 49 54 43 4F 44 45 00 00 )          // ...!BITCODE..
1384                 .maxstack 16
1385                 .locals init (
1386                         int32 res
1387                 )
1389                 .try { // 0
1390                         .try {
1391                                 ldstr "OnErrorSub test Exception"
1392                                 newobj instance void class [mscorlib]System.Exception::.ctor(string)
1393                                 throw 
1394                                 leave.s IL_0033
1395                         }
1396                         filter {
1397                                 pop
1398                                 ldc.i4.0
1399                                 endfilter
1400                         } {
1401                                 pop
1402                                 // Should not be called
1403                                 ldc.i4.2
1404                                 stloc res
1405                                 leave.s IL_0033
1406                         }
1407                 }
1408                 filter {
1409                         pop
1410                         ldc.i4.1
1411                         endfilter 
1412                 } {
1413                   pop
1414                   ldc.i4.1
1415                   stloc res       
1416                   leave.s IL_0033
1418                 }
1419                 IL_0033:
1420                 ldloc res
1421                 ret
1422         }
1424         .class nested private auto ansi sealed beforefieldinit TheStruct
1425                 extends [mscorlib]System.ValueType {
1426                 .field public int32 a
1427                 .field public int32 b
1428         }
1430         .method public static int32 test_5_cpobj () {
1431                 .maxstack 8
1432                 .locals init (  
1433                                 valuetype Tests/TheStruct v_0, 
1434                                 valuetype Tests/TheStruct v_1
1435                                          )
1437                 ldloca v_0
1438                 ldc.i4.2
1439                 stfld int32 Tests/TheStruct::a
1441                 ldloca v_0
1442                 ldc.i4.3
1443                 stfld int32 Tests/TheStruct::b
1445                 ldloca v_1
1446                 ldloca v_0
1447                 cpobj Tests/TheStruct
1449                 ldloca v_1
1450                 ldfld int32 Tests/TheStruct::a
1451                 ldloca v_1
1452                 ldfld int32 Tests/TheStruct::b
1453                 add
1455                 ret
1456         }
1458         .method public static int32 test_5_ldobj_stloc_optimization () {
1459                 .maxstack 8
1460                 .locals init (  
1461                                 valuetype Tests/TheStruct v_0, 
1462                                 valuetype Tests/TheStruct v_1
1463                                          )
1465                 ldloca v_0
1466                 ldc.i4.2
1467                 stfld int32 Tests/TheStruct::a
1469                 ldloca v_0
1470                 ldc.i4.3
1471                 stfld int32 Tests/TheStruct::b
1473                 ldloca v_0
1474                 ldobj valuetype Tests/TheStruct
1475                 stloc.s v_1
1477                 ldloca v_1
1478                 ldfld int32 Tests/TheStruct::a
1479                 ldloca v_1
1480                 ldfld int32 Tests/TheStruct::b
1481                 add
1483                 ret
1484         }
1486         .method public static int32 test_1_cpobj_reference () {
1487                 .maxstack 8
1488                 .locals init (  
1489                                 object v_0, 
1490                                 object v_1
1491                                          )
1493                 newobj instance void object::.ctor()
1494                 stloc v_0
1496                 ldloca v_1
1497                 ldloca v_0
1498                 cpobj object
1500                 ldloc v_0
1501                 ldloc v_1
1502                 ceq
1503                 ret
1504         }
1506         .method public static int32 test_1_initobj_reference () {
1507                 .maxstack 8
1508                 .locals init (  
1509                                 object v_0
1510                                          )
1512                 newobj instance void object::.ctor()
1513                 stloc v_0
1515                 ldloca v_0
1516                 initobj object
1518                 ldloc v_0
1519                 ldnull
1520                 ceq
1521                 ret
1522         }
1524         .method public static int32 test_1_ldobj_reference () {
1525                 .maxstack 8
1526                 .locals init (  
1527                                 object v_0
1528                                          )
1530                 newobj instance void object::.ctor()
1531                 stloc v_0
1533                 ldloc v_0
1534                 ldloca v_0
1535                 ldobj object
1536                 ceq
1537                 ret
1538         }
1540         .method public static int32 test_5_vtype_on_bb_boundary () {
1541                 .maxstack 8
1542                 .locals init (  
1543                                 valuetype Tests/TheStruct v_0, 
1544                                 valuetype Tests/TheStruct v_1
1545                                          )
1547                 ldloca v_0
1548                 ldc.i4.2
1549                 stfld int32 Tests/TheStruct::a
1551                 ldloca v_0
1552                 ldc.i4.3
1553                 stfld int32 Tests/TheStruct::b
1555                 ldloc v_0
1556                 br L_0
1557         L_0: stloc v_1
1559                 ldloca v_1
1560                 ldfld int32 Tests/TheStruct::a
1561                 ldloca v_1
1562                 ldfld int32 Tests/TheStruct::b
1563                 add
1564                 ret
1565         }
1567         .method public static int32 test_5_different_in_stacks () cil managed {
1568                 .maxstack 16
1570                         ldc.i4.1
1571                         ldc.i4.1
1572                         beq L_0
1574                         ldc.i4.3
1575                         ldc.i4.3
1576                         br L_1
1577                         ldc.i4.3
1578                         ldc.i4.3
1579                         br L_2
1580          L_0:   ldc.i4.2
1581                         ldc.i4.3
1582                         ldc.i4.1
1583                         ldc.i4.1
1584                         beq L_2
1585          L_1:   add
1586                         ret
1587          L_2:   add
1588                         ret
1589         }
1591         .method public static int32 test_3_larray_get_set () {
1592                 .locals init (
1593                         int32[2]        V_0)
1594                           
1595                         ldc.i4.2 
1596                         newobj instance void int32[0...]::.ctor(int32)
1597                         stloc.0 
1598                         ldloc.0 
1599                         ldc.i4.0 
1600                         ldc.i4 1
1601                         call instance void int32[0...]::Set(int32, int32)
1602                     ldloc.0 
1603                     ldc.i4.1 
1604                         ldc.i4 2
1605                         call instance void int32[0...]::Set(int32, int32)
1607                         ldloc.0
1608                         ldc.i4.0
1609                         call instance int32 int32[0...]::Get(int32)
1610                         ldloc.0
1611                         ldc.i4.1
1612                         call instance int32 int32[0...]::Get(int32)
1613                         add
1614                         ret
1615         }
1617         .method public static int32 test_0_pop_side_effects () {
1618                 .try {
1619                         ldc.r8 1
1620                         ldc.r8 0
1621                         div
1622                         ckfinite
1623                         pop
1624                         leave FAIL
1625                 }
1626                 catch [mscorlib]System.ArithmeticException {
1627                         pop
1628                         leave L_0
1629                 }
1630                 L_0:
1631                 ldc.i4.0
1632                 ret
1633                 FAIL:
1634                 ldc.i4.1
1635                 ret
1636         }
1638         .method public static void regalloc_regress_78314_helper (object o) cil managed
1639         {
1640                 ret
1641         }
1643         .method public static int32 test_1_regalloc_regress_78314 () cil managed
1644         {
1645     // Code size       68 (0x44)
1646     .maxstack  6
1647     .locals init (int32 V_0, bool V_1)
1648     IL_0000:  ldc.i4.0
1649     IL_0001:  stloc.0
1650     IL_0002:  br.s       IL_003b
1652     IL_0004:
1653     IL_001e:  ldc.i4.s   10
1654     IL_0020:  ldloc.0
1655     IL_0021:  shl
1656     IL_0022:  ldc.i4.s   10
1657     IL_0024:  ldloc.0
1658     IL_0025:  shl
1659     IL_0026:  ceq
1660     IL_0028:  box        [mscorlib]System.Boolean
1661     IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
1662     IL_0037:  ldloc.0
1663     IL_0038:  ldc.i4.1
1664     IL_0039:  add
1665     IL_003a:  stloc.0
1666     IL_003b:  ldloc.0
1667     IL_003c:  ldc.i4.8
1668     IL_003f:  blt.s      IL_0004
1670         ldloc.0
1671         ldc.i4.8
1672         ceq
1673         conv.i4
1674         ret     
1675   }
1677         .method public static void try_block_end_remove_if_useless () cil managed {
1678             .maxstack  8
1680             T_START:
1681                 ldstr   "Start"
1682                         pop
1683                 leave.s COMPLETE
1684             T1_END:
1686             COMPLETE:
1687                 ret
1689             F1_START:
1690                 ldstr   "Finally1"
1691                         pop
1692                 endfinally
1693             F1_END:
1695             .try T_START to T1_END finally handler F1_START to F1_END
1696         }
1698         .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1699                 call void class Tests::try_block_end_remove_if_useless ()
1700                 ldc.i4.0
1701                 ret
1702         }
1704    .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
1705     {
1706         ldc.i4.0
1707         switch (target)
1708         target: ldstr "bar"
1709                 pop
1710                 ldc.i4.0
1711         ret
1712     }
1714         // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1715         // generate the non .un version of the opcodes
1716     .method private static  hidebysig 
1717            default int32 test_4_float_branch_nan ()  cil managed 
1718     {
1719         // Method begins at RVA 0x27a4
1720         // Code size 74 (0x4a)
1721         .maxstack 2
1722         .locals init (
1723                 float64 V_0,
1724                 float64 V_1,
1725                 int32   V_2)
1726         IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
1727         IL_0009:  stloc.0 
1728         IL_000a:  ldc.r8 1.
1729         IL_0013:  stloc.1 
1730         IL_0014:  ldc.i4.0 
1731         IL_0015:  stloc.2 
1732         IL_0016:  ldloc.0 
1733         IL_0017:  ldloc.1 
1734         IL_0018:  bge.s IL_001a
1736                                 br L1
1737         IL_001a:  ldloc.2 
1738         IL_001b:  ret 
1739         L1:
1740         IL_001c:  ldloc.2 
1741         IL_001d:  ldc.i4.1 
1742         IL_001e:  add 
1743         IL_001f:  stloc.2 
1744         IL_0020:  ldloc.0 
1745         IL_0021:  ldloc.1 
1746         IL_0022:  ble.s IL_002e
1747                                 br L2
1748         IL_002e:  ldloc.2 
1749         IL_002f:  ret 
1750         L2:
1751         IL_0030:  ldloc.2 
1752         IL_0031:  ldc.i4.1 
1753         IL_0032:  add 
1754         IL_0033:  stloc.2 
1755         IL_0034:  ldloc.0 
1756         IL_0035:  ldloc.1 
1757         IL_0036:  blt.s IL_0038
1758                                 br L3           
1759         IL_0038:  ldloc.2 
1760         IL_0039:  ret 
1761         L3:
1762         IL_003a:  ldloc.2 
1763         IL_003b:  ldc.i4.1 
1764         IL_003c:  add 
1765         IL_003d:  stloc.2 
1766         IL_003e:  ldloc.0 
1767         IL_003f:  ldloc.1 
1768         IL_0040:  bgt.s IL_0042
1769                                 br L4
1770         IL_0042:  ldloc.2 
1771         IL_0043:  ret 
1772         L4:
1773         IL_0044:  ldloc.2 
1774         IL_0045:  ldc.i4.1 
1775         IL_0046:  add 
1776         IL_0047:  stloc.2 
1777         IL_0048:  ldloc.2 
1778         IL_0049:  ret 
1779     } // end of method Tests::test_5_float_branch_nan
1781     .method private static  hidebysig
1782            default void regress_80622_inner (object x)  cil managed
1783     {
1784                 .locals init (unsigned int8 i)
1785         // Method begins at RVA 0x2050
1786         // Code size 14 (0xe)
1787         .maxstack 8
1788         IL_1000:  ldarg.0
1789         IL_1001:  unbox unsigned int8
1790         IL_1006:  ldobj unsigned int8
1791         IL_000b:  conv.ovf.i4.un
1792         IL_000c:  pop
1793         IL_000d:  ret
1794     }
1796     // method line 2
1797     .method private static  hidebysig
1798            default int32 test_0_regress_80622 ()  cil managed
1799     {
1800         .maxstack 8
1801         IL_0000:  ldc.i4 255
1802         IL_0005:  box unsigned int8
1803         IL_000a:  call void class Tests::regress_80622_inner (object)
1804                 ldc.i4.0
1805         IL_000f:  ret
1806     }
1808         .method private static default int32 test_0_regresss_80190 () cil managed
1809         {
1810             .maxstack  2
1811             .locals init (int32 V_0,
1812                      int32* V_1)
1813             IL_0000:  nop
1814             IL_0001:  nop
1815             IL_0002:  ldloca.s   V_0
1816             IL_0004:  conv.u
1817             IL_0005:  stloc.1
1818             IL_0006:  ldloc.1
1819             IL_0007:  ldc.i4.3
1820             IL_0008:  stind.i4
1821             IL_0009:  nop
1822                                   ldc.i4.0
1823                                   ret
1824         }
1826         .class interface nested public auto ansi abstract IFaceWithStaticMethod
1827         {
1828             .method public static  specialname 
1829                default void foo ()  cil managed noinlining 
1830             {
1831                 .maxstack 0
1832                 IL_0000:  ret 
1833         }
1834         }
1835         
1836         .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1837         {
1838             .method public hidebysig  specialname  rtspecialname 
1839            instance default void .ctor ()  cil managed 
1840             {
1841                         .maxstack 8
1842                         ret
1843                 }
1845         }
1847         // Test that static methods in interfaces are ignored during vtable construction
1848         .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1849         {
1850                 .maxstack 16
1852                 newobj instance void class Tests/AClass::.ctor()
1853                 pop
1854                 ldc.i4.0
1855                 ret
1856         }
1858         .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
1859                 ldarg.0
1860                 box !!0
1861                 brtrue HAS_VALUE
1862                 ldc.i4.0
1863                 ret
1864 HAS_VALUE:      ldc.i4.1
1865                 ret
1866         }
1868         // bug 78019
1869         .method static public int32 test_0_nullable_box_brtrue () cil managed {
1871                 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1873                 ldloc.0
1874                 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1875                 ret
1876         }
1878         //Bug 372410
1879         .method static public int32 test_0_ldelema_type_check () cil managed {
1880                 .maxstack 16
1881                 .locals init (object[] V_0,
1882                                           object[,] V_1)
1884                 ldc.i4.1
1885                 newarr object
1886                 stloc.0
1888                 .try {
1889                         ldloc.0
1890                         ldc.i4.0
1891                         ldelema object
1892                         leave L1
1893                 } catch [mscorlib]System.ArrayTypeMismatchException {
1894                         leave ERROR1
1895                 }
1897         L1:
1898                 ldc.i4.1
1899                 newarr string
1900                 stloc.0
1902                 .try {
1903                         ldloc.0
1904                         ldc.i4.0
1905                         ldelema object
1906                         leave ERROR2
1907                 } catch [mscorlib]System.ArrayTypeMismatchException {
1908                         leave L2
1909                 }
1911         L2:
1912                         ldc.i4.1
1913                 newarr string
1914                 stloc.0
1916                 .try {
1917                         ldloc.0
1918                         ldc.i4.0
1919                         readonly. ldelema object
1920                         leave L3
1921                 } catch [mscorlib]System.ArrayTypeMismatchException {
1922                         leave ERROR3
1923                 }
1925         L3:
1926                 ldc.i4.0
1927                 ret
1930         ERROR1:
1931                 ldc.i4.1
1932                 ret
1934         ERROR2:
1935                 ldc.i4.2
1936                 ret
1938         ERROR3:
1939                 ldc.i4.3
1940                 ret
1941         }
1944         //Bug 372410
1945         .method static public int32 test_0_array_address_type_check () cil managed {
1946                 .maxstack 16
1947                 .locals init (object[] V_0,
1948                                           object[,] V_1)
1950                 ldc.i4.1 
1951             ldc.i4.1 
1952             newobj instance void object[,]::.ctor(int32, int32)
1953                 stloc.1
1955                 .try {
1956                         ldloc.1
1957                         ldc.i4.0
1958                         ldc.i4.0
1959                         call instance object&  object[,]::Address(int32, int32)
1960                         leave L4
1961                 } catch [mscorlib]System.ArrayTypeMismatchException {
1962                         leave ERROR4
1963                 }
1965         L4:
1966                 ldc.i4.1 
1967             ldc.i4.1 
1968             newobj instance void string[,]::.ctor(int32, int32)
1969                 stloc.1
1971                 .try {
1972                         ldloc.1
1973                         ldc.i4.0
1974                         ldc.i4.0
1975                         call instance object&  object[,]::Address(int32, int32)
1976                         leave ERROR5
1977                 } catch [mscorlib]System.ArrayTypeMismatchException {
1978                         leave L5
1979                 }
1981         L5:
1982                 ldc.i4.1 
1983             ldc.i4.1 
1984             newobj instance void string[,]::.ctor(int32, int32)
1985                 stloc.1
1987                 .try {
1988                         ldloc.1
1989                         ldc.i4.0
1990                         ldc.i4.0
1991                         readonly. call instance object&  object[,]::Address(int32, int32)
1992                         leave L6
1993                 } catch [mscorlib]System.ArrayTypeMismatchException {
1994                         leave ERROR6
1995                 }
1997         L6:
1998                 ldc.i4.0
1999                 ret
2000         ERROR4:
2001                 ldc.i4.4
2002                 ret
2004         ERROR5:
2005                 ldc.i4.5
2006                 ret
2008         ERROR6:
2009                 ldc.i4.6
2010                 ret
2011         }
2013         .field public  static unsigned int64 'ull'
2015         .field public  static int32 'shift2'
2017         .method public static int32 test_0_long_shift_regalloc () cil managed
2018         {
2019                 .locals init (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
2021                 .maxstack 4
2023                 ldc.i8  81985529234382576
2024                 stsfld  unsigned int64 Tests::ull
2025             ldc.i4      60
2026                 stsfld  int32 Tests::shift2
2028                 ldsfld  unsigned int64 Tests::ull
2029                 stloc   'cilsimp.27'
2030                 ldsfld  int32 Tests::shift2
2031                 stloc   'cilsimp.28'
2032                 ldloc   'cilsimp.27'
2033                 ldloc   'cilsimp.28'
2034                 shr.un
2035                 ldloc   'cilsimp.27'
2036                 ldc.i4  64
2037                 ldloc   'cilsimp.28'
2038                 sub
2039                 shl
2040                 or
2041                 ldc.i8  1311768467750121216
2042                 ceq
2043                 ldc.i4.1
2044                 xor
2045                 conv.u4
2046                 ret
2047         }
2049         // Test calling ldfld directly on a vtype instead of a vtype address
2050         .method public static int32 test_5_call_ldfld_vtype () cil managed
2051         {
2052                 .maxstack 16
2053                 .locals init (
2054                         valuetype Tests/TailCallStruct arg
2055                 )
2056                 ldloca 0
2057                 ldc.i4.2
2058                 stfld int32 Tests/TailCallStruct::a
2059                 ldloca 0
2060                 ldc.i4.4
2061                 stfld int32 Tests/TailCallStruct::b
2062                 ldloc.0
2063                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
2064                 ldfld int32 Tests/TailCallStruct::a
2065                 ret
2066         }
2068         .method public static int32 throw_ret () cil managed
2069         {
2070                 ldstr "FOO"
2071                 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
2072                 throw
2073                 ldc.i4.4
2074                 ret
2075         }
2077         .method public static int32 throw2_ret () cil managed
2078         {
2079                 // Disable inlining
2080                 ldc.i4.5
2081                 localloc
2082                 pop
2084                 call int32 Tests::throw_ret ()
2085                 ret
2086         }
2088         // Test inlining a method which contains just a throw
2089         .method public static int32 test_0_inline_throw () cil managed
2090         {
2091                 .maxstack 16
2092                 .locals init (
2093                                 int32 v_0
2094                 )
2096                 .try {
2097                         call int32 Tests::throw2_ret ()
2098                         stloc.0
2099                         leave L0
2100                 } catch [mscorlib]System.OverflowException {
2101                         pop
2102                         leave L1
2103                 }
2105                 L0:
2106                         ldc.i4.1
2107                         ret
2108                 L1:
2109                         ldc.i4.0
2110                         ret                     
2111         }
2113     .method public static int32 test_0_stelem_any_null_opt () cil managed
2114     {
2115                 .maxstack 16
2116                 .locals init (
2117                                 object[]        V_0,
2118                                 int32   V_1)
2120                 ldc.i4.s 10
2121                 newarr [mscorlib]System.Object
2122                 stloc.0
2124                 ldc.i4.0
2125                 stloc.1
2126                 br L0
2128         L1:
2129                 ldloc.0
2130                 ldloc.1
2131                 ldnull
2132                 stelem.any [mscorlib]System.Object
2133                 ldloc.1
2134                 ldc.i4.1
2135                 add
2136                 stloc.1
2137         L0:
2138                 ldloc.1
2139                 ldc.i4.s 10
2140                 blt L1
2142                 ldc.i4.0
2143                 ret
2144         }
2146     // method line 2
2147     .method public static  hidebysig 
2148            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 
2149     {
2150         // Method begins at RVA 0x20f4
2151         // Code size 44 (0x2c)
2152         .maxstack 8
2153         IL_0000:  ldarg.0 
2154         IL_0001:  ldarg.1 
2155         IL_0002:  add 
2156         IL_0003:  ldarg.2 
2157         IL_0004:  add 
2158         IL_0005:  ldarg.3 
2159         IL_0006:  add 
2160         IL_0007:  ldarg.s 4
2161         IL_0009:  add 
2162         IL_000a:  ldarg.s 5
2163         IL_000c:  add 
2164         IL_000d:  ldarg.s 6
2165         IL_000f:  add 
2166         IL_0010:  ldarg.s 7
2167         IL_0012:  add 
2168         IL_0013:  ldarg.s 8
2169         IL_0015:  add 
2170         IL_0016:  ldarg.s 9
2171         IL_0018:  add 
2172         IL_0019:  ldarg.s 10
2173         IL_001b:  add 
2174         IL_001c:  ldarg.s 11
2175         IL_001e:  add 
2176         IL_001f:  ldarg.s 12
2177         IL_0021:  add 
2178         IL_0022:  ldarg.s 13
2179         IL_0024:  add 
2180         IL_0025:  ldarg.s 14
2181         IL_0027:  add 
2182         IL_0028:  ldarg.s 15
2183         IL_002a:  add 
2184         IL_002b:  ret 
2185     } // end of method main::callee
2187     // method line 3
2188     .method public static  hidebysig 
2189            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 
2190     {
2191         // Method begins at RVA 0x2124
2192         // Code size 34 (0x22)
2193         .maxstack 17
2194         IL_0000:  ldarg.0 
2195                           ldc.i4.1
2196                           add
2197         IL_0001:  ldarg.1 
2198         IL_0002:  ldarg.2 
2199         IL_0003:  ldarg.3 
2200         IL_0004:  ldarg.s 4
2201         IL_0006:  ldarg.s 5
2202         IL_0008:  ldarg.s 6
2203         IL_000a:  ldarg.s 7
2204         IL_000c:  ldarg.s 8
2205         IL_000e:  ldarg.s 9
2206         IL_0010:  ldarg.s 10
2207         IL_0012:  ldarg.s 11
2208         IL_0014:  ldarg.s 12
2209         IL_0016:  ldarg.s 13
2210         IL_0018:  ldarg.s 14
2211                           ldc.i4.1
2212                           add
2213         IL_001a:  ldarg.s 15
2214                           ldc.i4.1
2215                           add
2216                   tail.
2217         IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
2218         IL_0021:  ret 
2219     } // end of method main::caller
2221     // method line 4
2222     .method public static  hidebysig 
2223            default int32 test_139_many_args_tail_call ()  cil managed
2224     {
2225                 // Some platforms might not be able to AOT tail calls
2226                 .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
2228         // Method begins at RVA 0x2154
2229         // Code size 43 (0x2b)
2230         .maxstack 17
2231         IL_0000:  ldc.i4.1 
2232         IL_0001:  ldc.i4.2 
2233         IL_0002:  ldc.i4.3 
2234         IL_0003:  ldc.i4.4 
2235         IL_0004:  ldc.i4.5 
2236         IL_0005:  ldc.i4.6 
2237         IL_0006:  ldc.i4.7 
2238         IL_0007:  ldc.i4.8 
2239         IL_0008:  ldc.i4.s 0x09
2240         IL_000a:  ldc.i4.s 0x0a
2241         IL_000c:  ldc.i4.s 0x0b
2242         IL_000e:  ldc.i4.s 0x0c
2243         IL_0010:  ldc.i4.s 0x0d
2244         IL_0012:  ldc.i4.s 0x0e
2245         IL_0014:  ldc.i4.s 0x0f
2246         IL_0016:  ldc.i4.s 0x10
2247         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)
2248         IL_0028:  ret 
2249     } // end of method main::Main
2251         .class nested private auto ansi beforefieldinit R1
2252            extends [mscorlib]System.MarshalByRefObject
2253         {
2254                 .field  public  int32 test_field
2256         .method public hidebysig  specialname  rtspecialname
2257                         instance default void '.ctor' ()  cil managed
2258         {
2259                         ret
2260                 }
2261         }
2263         .method public static hidebysig
2264                         default int32 return_0 () cil managed
2265         {
2266                 ldc.i4.0
2267                 ret
2268         }
2270         .method public static hidebysig
2271                         default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2272         {
2273                 .locals init (
2274                         class Tests/R1 v_0
2275                 )
2277                 newobj instance void class Tests/R1::.ctor ()
2278                 stloc.0
2279                 ldloc.0
2280                 ldc.i4.0
2281                 volatile.
2282                 stfld int32 Tests/R1::test_field
2283                 call int32 class Tests::return_0 ()
2284                 ldc.i4.1
2285                 add
2286                 ret
2287         }
2289         .method public static default int32 return_2 () cil managed
2290         {
2291                 // Prevent inlining
2292                 ldc.i4.s 16
2293         localloc
2294                 pop
2295                 ldc.i4.s 2
2296                 ret
2297         }
2299         .method public static hidebysig
2300                         default int32 test_1_cmov_opt_regress_463357 () cil managed
2301         {
2302                 call int32 class Tests::return_2 ()
2303                 ldc.i4.0
2304                 ceq
2305                 brfalse L1
2306                 ldc.i4.0
2307                 ret
2308                 br L2
2309         L1: nop
2310         L2: nop
2311                 ldc.i4.1
2312                 ret
2313         }
2315    .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1)  cil managed 
2316    {
2317       .maxstack 3
2318       .locals init (int32 V_0, bool V_1, bool V_2)
2319       
2320           ldc.i4.0
2321       IL_000b:  stloc.1 
2322       IL_000d:  br IL_002f
2324           ldc.i4.1    
2325           stloc.2
2326       IL_001e:  ldloc.2 
2327       IL_001f:  brfalse IL_0036
2329       IL_0024:  
2330       IL_002a:  br IL_0041
2331     
2332       IL_002f:  ldloc.1
2333       IL_0030:  stloc.2 
2334       IL_0031:  br IL_001e
2335     
2336       IL_0036:  ldc.i4 0
2337       IL_003b:  stloc.0 
2338       IL_003c:  br IL_0041
2339     
2340       IL_0041:  ldloc.0 
2341       IL_0042:  ret 
2342   } 
2344     .method public static default int32 test_0_cmov_opt_regress_474718 ()  cil managed 
2345     {
2346         .maxstack 16
2347         ldc.i4.1
2348         call int32 Tests::cmov_opt_regress_474718_inner (int32)
2349         ret
2350    }
2352         .method public static default int32 test_5_createarr_newobj () cil managed
2353         {
2354                 .maxstack 16
2356                 ldc.i4 5
2357                 newobj void char[]::.ctor(int32)
2358                 ldlen
2359                 ret
2360         }
2362         .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
2363         {
2364                 .maxstack 16
2365                 .locals init (native int)
2367                 ldc.i4.s 10
2368                 localloc
2369                 stloc.0
2371                 // Set the first value to 3
2372                 ldloc.0
2373                 ldc.i4.0
2374                 add             //addr
2375                 ldc.i4.3        //value
2376                 stind.i1
2378                 // Zero out the first 3 values
2379                 ldloc.0         //addr
2380                 ldc.i4.0        //value
2381                 ldc.i4.s 3      //size
2382                 initblk
2384                 // Load the first value
2385                 ldloc.0
2386                 ldc.i4.0
2387                 add     
2388                 ldind.u1
2389                 conv.i4
2390                 ret
2391         }
2393 /*         Disabled until they can be fixed to run on amd64
2394         .method public static float32 GetFloat32() cil managed noinlining
2395         {
2396                 .maxstack  8
2397                 ldc.r8     0.19975845134874831
2398                 ret
2399         }
2401         .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
2402         {
2403                 .maxstack 16
2405                 call float32 Tests::GetFloat32()
2406                 ldc.r8     0.19975845134874831
2407                 beq OK
2409                 ldc.i4.1
2410                 ret
2412                 ldc.i4.0
2413                 ret
2414         }
2417         .method public static default int32 test_0_long_to_r8_un_overflow () cil managed
2418         {
2419                 .maxstack 16
2420                 ldc.i8     0x00FFFFFFFFFFFFFF
2421                 conv.r.un
2422                 conv.i8
2423                 ldc.i8 0x100000000000000
2424                 beq OK_1
2426                 ldc.i4.1
2427                 ret
2428 OK_1:
2429                 ldc.i8     0x00FFFFFFFFFFFFFF
2430                 conv.r.un
2431                 conv.r8
2432                 conv.i8
2433                 ldc.i8 0x100000000000000
2434                 beq OK_2
2436                 ldc.i4.2
2437                 ret
2438 OK_2:
2439                 ldc.i4.0
2440                 ret
2441         }
2443         .field public static int32 shift1
2445         .method public static int32 regress_497271_helper (int32 i) cil managed
2446         {
2447                 ldarg.0
2448                 ret
2449         }
2451         .method public static int32 test_0_regalloc_regress_497271 () cil managed
2452         {
2453                 .locals init (int32 var)
2455                 ldc.i4  4
2456                 stsfld  int32 Tests::shift1
2457                 ldsfld  int32 Tests::shift1
2458                 stloc   var
2459                 ldc.i4  4660
2460                 ldloc   var
2461                 shr.un
2462                 ldc.i4  4660
2463                 ldc.i4  32
2464                 ldloc   var
2465                 sub
2466                 shl
2467                 or
2468                 ldc.i4  1073742115
2469                 beq     ?L10
2470 ?L9:
2471                 ldc.i4  1
2472                 call    int32 Tests::regress_497271_helper (int32)
2473                 ret
2474 ?L10:
2475                 ldc.i4  0
2476                 call    int32 Tests::regress_497271_helper (int32)
2477                 ret
2478         }
2480    .field  private static  int32 Value
2482   .method public static hidebysig  specialname 
2483           default int32 regress_513931_inner ()  cil managed 
2484     {                                                                 
2485         // Method begins at RVA 0x225c                                
2486         // Code size 52 (0x34)                                        
2487         .maxstack 2                                                   
2488         .locals init (                                                
2489                 int32   V_0,                                          
2490                 int32   V_1,                                          
2491                 bool    V_2)
2492                        
2493                                 ldc.i4 999
2494                                 stsfld int32 Tests::Value
2496         IL_0000:  nop                                                 
2497         IL_0001:  ldsfld int32 Tests::Value      
2498         IL_0006:  stloc.0                                             
2499         IL_0007:  ldloc.0                                             
2500         IL_0008:  ldc.i4.0                                            
2501         IL_0009:  cgt                                                 
2502         IL_000b:  ldc.i4.0                                            
2503         IL_000c:  ceq                                                 
2504         IL_000e:  stloc.2                                             
2505         IL_000f:  ldloc.2                                             
2506         IL_0010:  brtrue.s IL_0027                                    
2508         IL_0012:  nop 
2509         IL_0013:  ldloc.0 
2510         IL_0014:  ldc.i4.s 0x7b
2511         IL_0016:  ceq          
2512         IL_0018:  ldc.i4.0     
2513         IL_0019:  ceq          
2514         IL_001b:  stloc.2      
2515         IL_001c:  ldloc.2      
2516         IL_001d:  brtrue.s IL_0023
2518         IL_001f:  ldc.i4.m1 
2519         IL_0020:  stloc.1   
2520         IL_0021:  br.s IL_0032
2522         IL_0023:  ldc.i4.1 
2523         IL_0024:  stloc.1  
2524         IL_0025:  br.s IL_0032
2526         IL_0027:  
2527         IL_002c:  newobj instance void class [mscorlib]System.Exception::'.ctor'()
2528         IL_0031:  throw                                                                            
2529         IL_0032:  ldloc.1                                                                          
2530         IL_0033:  ret                                                                              
2531     }
2533         .method public static hidebysig  specialname 
2534          default int32 test_0_regress_513931 ()  cil managed 
2535         {
2536                 call int32 Tests::regress_513931_inner ()
2537                 pop
2538                 ldc.i4.0
2539                 ret
2540         }
2542         .method public static default int32 test_0_newarr_i8 () cil managed
2543         {
2544                 ldc.i4 1000
2545                 conv.i8
2546                 newarr [mscorlib]System.Boolean
2547                 pop
2548                 ldc.i4 0
2549                 ret
2550         }
2552         .method public static specialname 
2553                default int32 return_1_noinline ()  cil managed noinlining 
2554         {
2555                 .maxstack 0
2557                 ldc.i4.1
2558                 ret 
2559         }
2561         // Only happens with -O=-deadce,cmov
2562         .method public static default int32 test_0_cmov_unused_582322 () cil managed
2563         {
2564         .maxstack 2                                                   
2565         .locals init (                                                
2566                                 int32 V_0
2567                 )                               
2568                 call int32 Tests::return_1_noinline ()
2569                 ldc.i4.1
2570                 bne.un L0
2571                 ldloc.s 0
2572                 pop
2573         L0:
2574                 ldc.i4.0
2575                 ret
2576         }
2578     .method public static  hidebysig 
2579            default int32 test_0_regress_586664 ()  cil managed 
2580     {                                        
2581         // Method begins at RVA 0x20f4       
2582         // Code size 76 (0x4c)               
2583         .maxstack 6                          
2584         .locals init (                       
2585                 float64 V_0,                 
2586                 float64[]       V_1)         
2587         IL_0000:  ldc.r8 1.                  
2588         IL_0009:  ldc.r8 2.                  
2589         IL_0012:  ldc.r8 1.                  
2590         IL_001b:  call float64 class [mscorlib]System.Math::Pow(float64, float64)
2591         IL_0020:  div                                                            
2592         IL_0021:  stloc.0                                                        
2593         IL_0022:  ldc.i4.2                                                       
2594         IL_0023:  newarr [mscorlib]System.Double                                 
2595         IL_0028:  dup                                                            
2596         IL_0029:  ldc.i4.0                                                       
2597         IL_002a:  ldloc.0                                                        
2598         IL_002b:  neg                                                            
2599         IL_002c:  stelem.r8                                                      
2600         IL_002d:  dup                                                            
2601         IL_002e:  ldc.i4.1                                                       
2602         IL_002f:  ldloc.0
2603         IL_0030:  neg
2604         IL_0031:  stelem.r8
2605         IL_0032:  stloc.1
2606         IL_0033:  ldloc.1
2607         IL_0034:  ldc.i4.0
2608         IL_0035:  ldelem.r8
2609         IL_0036:  ldc.r8 -0.5
2610         IL_003f:  bne.un IL_004a
2612         IL_0044:  ldc.i4.0
2613         IL_0045:  br IL_004b
2615         IL_004a:  ldc.i4.1
2616         IL_004b:  ret
2617     }
2619         .method public static int32 test_2_leave_multiple_blocks_from_end ()
2620         {
2621                 .locals init (int32 V_0)
2623                 .try {
2624                         .try {
2625                                 nop
2626                                 nop
2627                                 leave END
2628                         } finally {
2629                                 ldloc.0
2630                                 ldc.i4.1
2631                                 add
2632                                 stloc.0
2633                                 endfinally
2634                         }
2635                         nop
2636                         leave END
2637                 } finally {
2638                         ldloc.0
2639                         ldc.i4.1
2640                         add
2641                         stloc.0
2642                         endfinally
2643                 }
2644 END:
2645                 ldloc.0
2646                 ret
2647         }
2649         .method public static int32 test_3_leave_multiple_blocks_from_hole ()
2650         {
2651                 .locals init (int32 V_0)
2653                 .try {
2654                         .try {
2655                                 ldloc.0
2656                                 brtrue REST
2657                                 leave BEFORE_END
2658 REST:
2659                                 nop
2660                                 nop
2661                                 leave END
2662                         } finally {
2663                                 ldloc.0
2664                                 ldc.i4.1
2665                                 add
2666                                 stloc.0
2667                                 endfinally
2668                         }
2669                         nop
2670                         leave END
2671                 } finally {
2672                         ldloc.0
2673                         ldc.i4.1
2674                         add
2675                         stloc.0
2676                         endfinally
2677                 }
2678 BEFORE_END:
2679                 ldloc.0
2680                 ldc.i4.1
2681                 add
2682                 stloc.0
2683 END:
2684                 ldloc.0
2685                 ret
2686         }
2688         .class nested private auto ansi sealed beforefieldinit Pair`2<TKey,TValue>
2689                    extends [mscorlib]System.ValueType
2690         {
2691                 .field  public  !0 key
2692         .field  public  !1 'value'
2693         }
2695     .method private static hidebysig 
2696            default bool ContentEquals<TKey,TValue> (valuetype Tests/Pair`2<!!TKey, !!TValue> v)  cil managed 
2697     {
2698         .maxstack 8
2699         IL_0000:  ldarga.s 0 
2700         IL_0006:  ldnull 
2701                           constrained. valuetype Tests/Pair`2<!!0,!!1>
2702         IL_0007:  callvirt instance bool class [mscorlib]System.Object::Equals(object)
2703                           ret
2704     }
2706     .method public static hidebysig default int32 test_0_constrained_gshared_595863 () cil managed
2707     {
2708                 .locals init (
2709                 valuetype Tests/Pair`2<string, string>  V_0,
2710                 valuetype Tests/Pair`2<string, string>  V_1)
2711         IL_0000:  ldloca.s 0
2712         IL_0002:  initobj valuetype Tests/Pair`2<string,string>
2713         IL_0008:  ldloc.0 
2714         IL_0009:  stloc.1 
2715         IL_000a:  ldloca.s 1
2716         IL_000c:  ldstr "A"
2717         IL_0011:  stfld !0 valuetype Tests/Pair`2<string,string>::key
2718         IL_0016:  ldloca.s 1
2719         IL_0018:  ldstr "B"
2720         IL_001d:  stfld !1 valuetype Tests/Pair`2<string,string>::'value'
2721         IL_0022:  ldloc.1 
2722         IL_0023:  stloc.0 
2723         IL_0024:  ldloc.0 
2724         IL_0025:  call bool class Tests::ContentEquals<string, string> (valuetype Tests/Pair`2<!!0,!!1>)
2725                           brfalse SUCCESS
2726                           ldc.i4.1
2727                           ret
2728         SUCCESS:
2729                           ldc.i4.0
2730                           ret
2731     }
2733         .method public static default int32 test_0_wrap_non_exception_throws () cil managed
2734         {
2735           .try {
2736                     newobj instance void class [mscorlib]System.Object::'.ctor'()
2737                         throw
2738                   leave IL_0
2739           } catch class [mscorlib]System.Runtime.CompilerServices.RuntimeWrappedException {
2740                   leave IL_0
2741                 }
2742                 IL_0:
2743                 ldc.i4.0
2744                 ret
2745     }
2747         .method public static default int32 test_0_typespec_modopt () cil managed {
2748                 ldtoken class Tests modopt (Tests)
2749                 pop
2750                 ldc.i4.0
2751                 ret
2752         }
2754         .method public hidebysig static int32 SizeOfT<T>() cil managed
2755         {
2756                 .maxstack  8
2757     
2758                 sizeof !!0
2759         ret
2760         }
2762         .method public static default int32 test_1_sizeof_gshared () cil managed {
2763             call   int32 Tests::SizeOfT<int8>()
2764                 ldc.i4.1
2765                 ceq
2766                 ret
2767         }
2769         .method public static default int32 test_1_sizeof_ref () cil managed {
2770             call   int32 Tests::SizeOfT<object>()
2771                 sizeof [mscorlib]System.IntPtr
2772                 ceq
2773                 ret
2774         }
2776   .field static public int32 volatile_int
2778         .method public static default int32 test_5_volatile_load_store () cil managed {
2779                 ldsflda int32 class Tests::volatile_int
2780                 ldc.i4 5
2781                 volatile.
2782                 stind.i4
2783                 ldsflda int32 class Tests::volatile_int
2784                 volatile.
2785                 ldind.i4
2786                 ret
2787         }               
2789     .method public static 
2790            default int32 regress_693905_inner (int32 x, int32 acc)  cil managed 
2791     {
2792         // Method begins at RVA 0x2050
2793         // Code size 17 (0x11)
2794         .maxstack 5
2795         IL_0000:  ldarg.0 
2796         IL_0001:  brtrue.s IL_0005
2798         IL_0003:  ldarg.1 
2799         IL_0004:  ret 
2800         IL_0005:  ldarg.0 
2801         IL_0006:  ldc.i4.1 
2802         IL_0007:  sub 
2803         IL_0008:  ldarg.1 
2804         IL_0009:  ldc.i4.1 
2805         IL_000a:  add 
2806         IL_000b:  starg.s 1
2807         IL_000d:  starg.s 0
2808         IL_000f:  br.s IL_0000
2810     } // end of method Test::f
2812     .method public static 
2813            default int32 test_10_regress_693905 ()  cil managed 
2814         {
2815                 ldc.i4.s 0x0a
2816         ldc.i4.0 
2817         call int32 class Tests::regress_693905_inner(int32, int32)
2818                 ret
2819         }
2821         .method public static
2822                         default int32 test_0_llvm_regress_171 () cil managed
2823         {
2824                 .locals init (
2825                         int32 i
2826                 )
2828                 call int32 Tests::return_1_noinline ()
2829                 ldc.i4.1
2830                 beq L1
2831                 ldc.i4.1
2832                 stloc.s 0
2833                 call int32 Tests::return_1_noinline ()
2834                 ldc.i4.0
2835                 beq L1
2836                 L1:
2837                 ldloc.s 0
2838                 ret
2839         }
2841      .field  public static int32 static_a
2843         .method public static
2844                         default int32 test_4_ldfld_stfld_static () cil managed
2845         {
2846                 ldnull
2847                 ldc.i4 2
2848                 stfld int32 Tests::static_a
2849                 ldnull
2850                 ldfld int32 Tests::static_a
2851                 ldnull
2852                 ldflda int32 Tests::static_a
2853                 ldind.i4
2854                 add
2855                 ret
2856         }
2858   .method public static default int32 no_initlocals_inner () cil managed
2859   {
2860     .locals (
2861         int32 V_0,
2862         float32 V_1,
2863         float64 V_2,
2864         valuetype Tests/TailCallStruct V_3)
2865        ldloc V_0
2866        ret
2867   }
2869   .method public static default int32 test_0_no_initlocals () cil managed
2870   {
2871        call int32 Tests::no_initlocals_inner()
2872        pop
2873            ldc.i4.0
2874        ret
2875   }
2877   .method public hidebysig static int32  test_5_r4_fadd_mixed() cil managed
2878   {
2879     // Code size       17 (0x11)
2880     .maxstack  2
2881     .locals init (float32 V_0,
2882              float64 V_1)
2883     IL_0000:  ldc.r4     3
2884     IL_0005:  stloc.0
2885     IL_0006:  ldc.r8     2
2886     IL_000b:  stloc.1
2887     IL_000c:  ldloc.0
2888     IL_000d:  ldloc.1
2889     IL_000e:  add
2890     IL_000f:  conv.i4
2891     IL_0010:  ret
2892   }
2894  .method public hidebysig static int32  test_0_fcmp_eq_r4_mixed() cil managed
2895   {
2896     // Code size       32 (0x20)
2897     .maxstack  2
2898     .locals init (float32 V_0,
2899              float64 V_1)
2900     IL_0000:  ldc.r4     1
2901     IL_0005:  stloc.0
2902     IL_0006:  ldc.r8     1
2903     IL_000f:  stloc.1
2904     IL_0010:  ldloc.0
2905     IL_0012:  ldloc.1
2906     IL_0013:  bne.un     IL_001e
2908     IL_0018:  ldc.i4.0
2909     IL_0019:  br         IL_001f
2911     IL_001e:  ldc.i4.1
2912     IL_001f:  ret
2913   } // end of method Tests::test_0_fcmp_eq_r4_mixed
2915   .method public hidebysig static int32  test_0_fceq_r4_mixed() cil managed
2916   {
2917     // Code size       31 (0x1f)
2918     .maxstack  2
2919     .locals init (float32 V_0,
2920              float64 V_1,
2921              bool V_2)
2922     IL_0000:  ldc.r4     1
2923     IL_0005:  stloc.0
2924     IL_0006:  ldc.r8     1
2925     IL_000b:  stloc.1
2926     IL_000c:  ldloc.0
2927     IL_000d:  ldloc.1
2928     IL_000e:  ceq
2929     IL_0010:  stloc.2
2930     IL_0011:  ldloc.2
2931     IL_0012:  brfalse    IL_001d
2933     IL_0017:  ldc.i4.0
2934     IL_0018:  br         IL_001e
2936     IL_001d:  ldc.i4.1
2937     IL_001e:  ret
2938   } // end of method Tests::test_0_fceq_r4
2940   .method public static int32 test_0_switch_loop () cil managed
2941   {
2942         .maxstack 16
2943         .locals init (valuetype Tests/TailCallStruct V_0, int32 V_1)
2944         ldc.i4.0
2945         ldloc.0
2946         ldloc.1
2947         brtrue L_1
2948         L_0:
2949         ldc.i4.4
2950         switch (L_0)
2951         L_1:
2952         pop
2953         ret
2954   }
2956   .method public static int32 test_2_fault () cil managed
2957   {
2958         .maxstack 16
2959         .locals init (int32 V_0)
2960     IL_0000:  ldc.i4.0
2961     IL_0001:  stloc.0
2962     .try
2963     {
2964       .try
2965       {
2966         IL_0002:  newobj     instance void [mscorlib]System.Exception::.ctor()
2967         IL_0007:  throw
2968                 leave.s    IL_0018
2969       }  // end .try
2970           fault
2971       {
2972         IL_0009:  ldloc.0
2973         IL_000a:  ldc.i4.1
2974         IL_000b:  add
2975         IL_000c:  stloc.0
2976                                   endfinally
2977       }  // end handler
2978       IL_000f:  leave.s    IL_0018
2980     }  // end .try
2981     catch [mscorlib]System.Object
2982     {
2983       IL_0011:  pop
2984       IL_0012:  ldloc.0
2985       IL_0013:  ldc.i4.1
2986       IL_0014:  add
2987       IL_0015:  stloc.0
2988       IL_0016:  leave.s    IL_0018
2990     }  // end handler
2991     IL_0018:  ldloc.0
2992         ret
2993         }
2995   .method public static int32 test_0_fault_no_exception () cil managed
2996   {
2997         .maxstack 16
2998         .locals init (int32 V_0)
2999     IL_0000:  ldc.i4.0
3000     IL_0001:  stloc.0
3001     .try
3002     {
3003       .try
3004       {
3005                 leave.s    IL_0018
3006       }  // end .try
3007           fault
3008       {
3009         IL_0009:  ldloc.0
3010         IL_000a:  ldc.i4.1
3011         IL_000b:  add
3012         IL_000c:  stloc.0
3013                                   endfinally
3014       }  // end handler
3015       IL_000f:  leave.s    IL_0018
3017     }  // end .try
3018     catch [mscorlib]System.Object
3019     {
3020       IL_0011:  pop
3021       IL_0012:  ldloc.0
3022       IL_0013:  ldc.i4.1
3023       IL_0014:  add
3024       IL_0015:  stloc.0
3025       IL_0016:  leave.s    IL_0018
3027     }  // end handler
3028     IL_0018:  ldloc.0
3029         ret
3030         }
3032     .field  private static  int32 byte_val
3033     .field  private static  int32 short_val
3035     .method static int32 widen_arguments (unsigned int8 a, int8 b, int16 c, unsigned int16 d) cil managed noinlining
3036     {
3037                 .maxstack 4
3038                 ldsfld int32 Tests::byte_val
3039                 starg.s 0
3040                 ldarg.0
3041                 ldc.i4 128 //0x80
3042                 beq L_0
3044                 ldc.i4.1
3045                 ret
3046 L_0:
3047                 ldsfld int32 Tests::byte_val
3048                 starg.s 1
3049                 ldarg.1
3050                 ldc.i4 -128 //-0x80
3051                 beq L_1
3053                 ldc.i4.2
3054                 ret
3056 L_1:
3057                 ldsfld int32 Tests::short_val
3058                 starg.s 2
3059                 ldarg.2
3060                 ldc.i4 -32768 //-0x8000
3061                 beq L_2
3063                 ldc.i4.3
3064                 ret
3066 L_2:
3067                 ldsfld int32 Tests::short_val
3068                 starg.s 3
3069                 ldarg.3
3070                 ldc.i4 32768 //0x8000
3071                 beq L_3
3073                 ldc.i4.4
3074                 ret
3076 L_3:
3077                 ldc.i4.0
3078                 ret
3079     }
3081         .method public static int32 test_0_implicit_widen_of_argument_stores () cil managed
3082         {
3083                 .maxstack 5
3084                 /*
3085                 This test verifies that storing an I4 value from the evail stack into a local variable triggers proper widening.
3086                 The values are picked so storing them have different values depending on the sign'ness of the local variable.
3087                 */
3088                 ldc.i4 0x180
3089                 stsfld int32 Tests::byte_val
3090                 ldc.i4 0x18000
3091                 stsfld int32 Tests::short_val
3093                 ldc.i4.0
3094                 ldc.i4.0
3095                 ldc.i4.0
3096                 ldc.i4.0
3097                 call int32 Tests::widen_arguments (unsigned int8 a, int8 b, int16 c, unsigned int16 d)
3098                 ret
3099         }
3101     .method public static int32 test_0_implicit_widen_of_local_stores () cil managed
3102     {
3103                 .maxstack 4
3104                 .locals init (
3105                         unsigned int8   V_0,
3106                         int8    V_1,
3107                         int16   V_2,
3108                         unsigned int16  V_3)
3110                 /*
3111                 This test verifies that storing an I4 value from the evail stack into a local variable triggers proper widening.
3112                 The values are picked so storing them have different values depending on the sign'ness of the local variable.
3113                 */
3114                 ldc.i4 0x180
3115                 stsfld int32 Tests::byte_val
3116                 ldc.i4 0x18000
3117                 stsfld int32 Tests::short_val
3119                 ldsfld int32 Tests::byte_val
3120                 stloc.0
3121                 ldloc.0
3122                 ldc.i4 128 //0x80
3123                 beq L_0
3125                 ldc.i4.1
3126                 ret
3127 L_0:
3128                 ldsfld int32 Tests::byte_val
3129                 stloc.1
3130                 ldloc.1
3131                 ldc.i4 -128 //-0x80
3132                 beq L_1
3134                 ldc.i4.2
3135                 ret
3136 L_1:
3137                 ldsfld int32 Tests::short_val
3138                 stloc.2
3139                 ldloc.2
3140                 ldc.i4 -32768 //-0x8000
3141                 beq L_2
3143                 ldc.i4.3
3144                 ret
3145 L_2:
3146                 ldsfld int32 Tests::short_val
3147                 stloc.3
3148                 ldloc.3
3149                 ldc.i4 32768 //0x8000
3150                 beq L_3
3152                 ldc.i4.4
3153                 ret
3154 L_3:
3155                 ldc.i4.0
3156                 ret
3157     }
3159         .method public static bool llvm_regress_59436 () {
3160                 // Code size       41 (0x29)
3161                 .maxstack  3
3162                 .locals init (float64 V_0,
3163                                           float64 V_1,
3164                                           valuetype [mscorlib]System.Decimal V_2)
3165                 IL_0000:  ldc.r8         1
3166                 IL_0009:  stloc.0
3167                 IL_000a:  ldc.r8         2
3168                 IL_0013:  stloc.1
3169                 IL_0014:  ldloc.0
3170                 IL_0015:  newobj         instance void [mscorlib]System.Decimal::.ctor(float64)
3171                 IL_001a:  ldloca.s   V_2
3172                 IL_001c:  ldloc.1
3173                 IL_001d:  call     instance void [mscorlib]System.Decimal::.ctor(float64)
3174                 IL_0022:  ldloc.2
3175                 IL_0023:  call     bool [mscorlib]System.Decimal::op_LessThanOrEqual(valuetype [mscorlib]System.Decimal,
3176                                                                                                                                                            valuetype [mscorlib]System.Decimal)
3177                 IL_0028:  ret
3178         }
3180   .method private hidebysig static void  fail_inline() cil managed
3181   {
3182     // Code size       9 (0x9)
3183     .maxstack  8
3184     IL_0000:  ldc.i4.s   16
3185     IL_0002:  conv.u
3186     IL_0003:  ldc.i4.1
3187     IL_0004:  mul.ovf.un
3188     IL_0005:  localloc
3189     IL_0007:  pop
3190     IL_0008:  ret
3191   }
3193   .method private hidebysig static int32
3194           always_inline(int32 op) cil managed aggressiveinlining
3195   {
3196     // Code size       24 (0x18)
3197     .maxstack  8
3198     IL_0000:  ldarg.0
3199     IL_0001:  brfalse.s  IL_0009
3201     IL_0003:  ldarg.0
3202     IL_0004:  ldc.i4.2
3203     IL_0005:  beq.s      IL_000b
3205     IL_0007:  br.s       IL_000d
3207     IL_0009:  ldc.i4.0
3208     IL_000a:  ret
3210     IL_000b:  ldc.i4.3
3211     IL_000c:  ret
3213     IL_000d:  call       void Tests::fail_inline()
3214     IL_0012:  newobj     instance void [mscorlib]System.Exception::.ctor()
3215     IL_0017:  throw
3216   }
3218   .method public hidebysig static int32 test_3_regress_59608() cil managed
3219   {
3220     .maxstack  8
3221     IL_0000:  ldc.i4.2
3222     IL_0001:  call       int32 Tests::always_inline(int32)
3223     IL_000c:  ret
3224   }
3226   .method public hidebysig static int32 test_104_conv_u_and_string() cil managed
3227   {
3228     .maxstack  8
3229         ldstr "hello"
3230         conv.u
3231         call int32 [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData()
3232         add
3233         ldind.u2
3234         ret
3235   }
3237   .field public static class FLSharedKeys* keys
3239   .method public hidebysig static int32 test_0_regress_60634 () cil managed
3240   {
3241         .maxstack 8
3242         ldsflda     class FLSharedKeys* Tests::keys
3243         initobj    class FLSharedKeys*
3244         ldc.i4.0
3245         ret
3246   }
3248   .method public hidebysig static int32 test_0_github_issue_6721 () cil managed
3249   {
3250        .maxstack 8
3251        ldc.i4.0
3252        conv.i8
3253        ldc.i4.m1
3254        conv.ovf.i8.un
3255        sub.ovf
3256        ldc.i8 0xffffffff00000001
3257        beq.s IL_success
3258        ldc.i4.1
3259        ret
3260        IL_success:
3261        ldc.i4.0
3262        ret
3263   }
3265   .method public hidebysig static int32 test_3_github_issue_15794 () cil managed
3266   {
3267       .maxstack 8
3268       ldc.r8 3.4
3269       conv.r.un
3270       conv.i4
3271       ret
3272   }
3274   .method public hidebysig static int32 test_1_box_r8_r4_autoconv () cil managed
3275   {
3276                 ldc.r8 1.234
3277                 box float64
3278                 unbox float64
3279                 ldind.r8
3280                 box float32
3281                 unbox float32
3282                 ldind.r4
3283                 conv.r8
3284                 conv.i4
3285                 ret
3286         }
3288         .method public hidebysig static int32 test_1_dont_verify_ptr_byrefs () cil managed
3289          {
3290                 .locals init (int32 v_0, int32 *& v_1, int32 *v_2)
3292                 //v_0 = 1
3293                 ldc.i4.1
3294                 stloc.0
3296                 //v_1 = &v_0 < bad store of `int32&` to ìnt32*&` but must work
3297                 ldloca v_0
3298                 stloc.1
3300                 //v_2 = (intptr)v_1
3301                 ldloc.1
3302                 conv.u
3303                 stloc.2
3305                 //return *v_2
3306                 ldloc.2
3307                 ldind.i4
3308                 ret
3309          }
3311         .method private hidebysig static valuetype [mscorlib]System.Nullable`1<int32> ret_some_vt(int32 val) cil managed
3312          {
3313                 .maxstack 8
3314                 ldarg.0
3315                 newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
3316                 ldarg.0
3317                 ldc.i4.0
3318                 ble.s second_vt
3320                 ldarg.0
3321                 ldc.i4.s 40
3322                 add
3323                 newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
3324                 pop
3325                 ret
3327 second_vt_2:
3328                 ldarg.0
3329                 ldc.i4.s 30
3330                 add
3331                 newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
3332                 ret
3334 second_vt:
3335                 pop
3336                 br second_vt_2
3337          }
3339         // https://github.com/mono/mono/issues/17924
3340         .method static public int32 test_0_vt_sp_tracking () cil managed
3341          {
3342                 .maxstack  2
3343                 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
3345                 ldc.i4.s 10
3346                 call valuetype [mscorlib]System.Nullable`1<int32> Tests::ret_some_vt(int32)
3347                 stloc.0
3348                 ldloca.s V_0
3349                 call instance !0 valuetype [mscorlib]System.Nullable`1<int32>::get_Value()
3350                 ldc.i4.s 10
3351                 bne.un.s wrong
3353                 ldc.i4.0
3354                 ret
3356 wrong:
3357                 ldc.i4.1
3358                 ret
3359         }
3361   .method public hidebysig static int32  test_10_rconv_to_u8_ovf_un() cil managed
3362   {
3363     // Code size       20 (0x14)
3364     .maxstack  1
3365     .locals init (uint64 V_0,
3366              float32 V_1,
3367              int32 V_2)
3368     IL_0000:  nop
3369     IL_0001:  ldc.i4.s   10
3370     IL_0003:  conv.i8
3371     IL_0004:  stloc.0
3372     IL_0005:  ldloc.0
3373     IL_0006:  conv.r.un
3374     IL_0007:  conv.r4
3375     IL_0008:  stloc.1
3376     IL_0009:  nop
3377     IL_000a:  ldloc.1
3378     IL_000b:  conv.ovf.u8.un
3379     IL_000c:  stloc.0
3380     IL_000d:  ldloc.0
3381     IL_000e:  conv.ovf.i4.un
3382     IL_000f:  stloc.2
3383     IL_0010:  br.s       IL_0012
3385     IL_0012:  ldloc.2
3386     IL_0013:  ret
3387   } // end of method Tests::test_10_rconv_to_u8_ovf_un
3389   .field private static int64 TestLong
3391 /* Disabled until its fixed on i386
3392   .method public static int32 test_1_stsfld_conv () cil managed
3393   {
3394         ldc.i4.2
3395         stsfld int64 Tests::TestLong
3396         ldsfld int64 Tests::TestLong
3397         ldc.i8 2
3398         ceq
3399         ret
3400    }