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