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