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