New test.
[mono.git] / mono / mini / iltests.il
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         .method static public int32 test_0_tail_calls () il managed {
490                 .maxstack 16
491                 .locals init (
492                         valuetype Tests/TailCallStruct arg
493                 )
494                 ldloca 0
495                 ldc.i4.2
496                 stfld int32 Tests/TailCallStruct::a
497                 ldloca 0
498                 ldc.i4.4
499                 stfld int32 Tests/TailCallStruct::b
500                 ldloc.0
501                 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
502                 stloc.0
503                 ldloca 0
504                 ldfld int32 Tests/TailCallStruct::a
505                 ldloca 0
506                 ldfld int32 Tests/TailCallStruct::b
507                 add
508                 ldc.i4 9
509                 sub
510                 ret
511         }
512
513         .method public static int32 test_5_jmp () cil managed {
514                 jmp int32 Tests::jmp2 ()
515                 ldc.i4.0
516                 ret
517         }
518
519         .method public static int32 jmp2 () cil managed {
520                 ldc.i4.5
521                 ret
522         }               
523
524         .method static public int32 test_11_switch_with_nonempty_stack () il managed {
525                 .maxstack 16
526
527                 ldc.i4.5
528                 ldc.i4.6
529                 ldc.i4.1
530                 switch (L0, L1)
531         L0: 
532                 add
533                 ret
534         L1:
535                 add
536                 ret
537         }
538  
539     .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
540                 .maxstack 16
541
542         .try {
543           leave IL_0
544         }
545         finally  {
546           ldc.i4.0
547           endfinally
548         }
549         IL_0:  ldc.i4.5
550                 ret
551     }
552
553         .method public static int32 test_0_conv_ovf_i8_neg () il managed {
554                 .maxstack 16
555
556                 ldc.i4.m1
557                 conv.ovf.i8
558                 conv.i4
559                 ldc.i4.m1
560                 beq L_OK
561                 ldc.i4.1
562                 ret
563         L_OK:
564                 ldc.i4.0
565                 ret
566         }               
567
568         .method public static int32 test_1234_conv_u4 () il managed {
569                 .maxstack 16
570
571                 ldc.i4 1234
572                 conv.u4
573                 conv.i4
574                 ret
575         }
576
577         .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
578         {
579                 .maxstack 16
580         
581                 ldc.i4.1
582                 brfalse OBJECT
583         
584                 ldtoken [mscorlib]System.String
585                 br AFTER
586         OBJECT:
587                 ldtoken [mscorlib]System.Object
588         AFTER:
589                 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
590                 callvirt instance string class [mscorlib]System.Type::get_FullName ()
591                 ldstr "System.String"
592                 callvirt instance bool class [mscorlib]System.Object::Equals(object)
593                 ldc.i4.0
594                 ceq
595                 ret 
596         }
597                 
598         .method public static int32 test_0_bug59580  ()
599         {
600                 ldc.r4          float32(0x7FC00000)
601                 ldc.r4          float32(0x7FC00000)
602                 bge.un          pass
603                 br              fail
604         pass:
605                 ldc.i4.0
606                 ret
607         fail:
608                 ldc.i4.1
609                 ret
610         }
611         
612         .method public static int32 test_1_bug60056  () {
613                 .locals init (int32 m5)
614                         
615                 ldc.i4.m1
616                 stloc.0
617                 
618                 ldc.i4.1
619                 conv.u8
620                 
621                 ldloc.0
622                 conv.i8
623                 mul
624                 
625                 ldc.i4.m1
626                 conv.i8
627                 ceq
628                 ret
629         }
630         
631         .method public static int32 test_1_conv_u8_cfold  () {
632                 ldc.i4.m1
633                 conv.u8
634                 
635                 ldc.i8 0x00000000ffffffff
636                 
637                 ceq
638                 ret
639         }
640         
641         .method public static int32 test_1_array_type_mismatch_ldelema  () {
642                 .locals init (int32 r)
643                 
644                         ldc.i4.1
645                         newarr string
646                         ldc.i4.0 
647                         ldelema string
648                         pop
649                 
650                 .try {
651                         ldc.i4.1
652                         newarr string
653                         ldc.i4.0 
654                         ldelema object
655                         pop
656                         
657                         leave end
658                 } catch [mscorlib]System.ArrayTypeMismatchException {
659                         pop
660                         ldc.i4.1
661                         stloc.0
662                         leave end
663                 }
664         end:
665                 ldloc.0
666                 ret
667         }
668
669         .method public static int32 test_1_conv_ovf_i8_with_i4 () {
670                         ldc.i4.m1 
671                         conv.ovf.i8
672                         conv.ovf.i4
673                         neg
674                         ret
675         }
676
677         // bug #72148
678     .method public static int32 test_0_initlocals_float_ptr () {
679         .maxstack 3
680         .locals init (
681                 float32[]       V_0,
682                 float32& pinned V_1,
683                 unsigned int32  V_2)
684                         ldc.i4.s 0x0f
685                         newarr [mscorlib]System.Single
686                         stloc.0 
687                         ldloc.0 
688                         ldc.i4.0 
689                         ldc.r4 1.13
690                         stelem.r4 
691                         ldloc.0 
692                         ldc.i4.0 
693                         ldelema [mscorlib]System.Single
694                         stloc.1 
695                         ldloc.1 
696                         conv.i 
697                         ldind.u4 
698                         stloc.2 
699                         ldc.i4.0
700                         ret
701         }
702
703         .method public static int32 test_7_conv_ovf_u8_un () {
704         .maxstack  2
705         .locals    init (unsigned int64)
706
707         ldc.i4.7
708         conv.ovf.u8.un
709         stloc.0
710                 ldloc.0
711                 conv.i4
712         ret
713         }
714
715         .method public static int32 test_1_bug_74591 () {
716                 .maxstack 16
717                 .locals init (int32)
718
719                 ldc.i4.m1
720                 stloc.0
721                 ldloc.0
722                 conv.ovf.i8
723                 ldc.i4.m1
724                 conv.ovf.i8
725                 mul.ovf
726                 conv.i4
727                 ret
728         }
729
730         .class nested public auto ansi Integer
731                 extends [mscorlib]System.Object {
732
733                 .field public bool n
734
735             .method public hidebysig  specialname  rtspecialname 
736            instance default void .ctor (unsigned int64 i, bool n)  cil managed 
737             {
738                         .maxstack 8
739                         ldarg.0
740                         call instance void class [mscorlib]System.Object::.ctor()
741                         ldarg.0
742                         ldarg.2
743                         stfld bool Tests/Integer::n
744                         ret
745                 }
746         }
747
748         .method public static int32 test_1_bug_74726 () {
749                 .maxstack 16
750
751                 ldc.i4.2
752                 conv.ovf.u8
753                 ldc.i4.1
754                 conv.ovf.u8
755                 mul.ovf.un
756                 ldc.i4.1
757                 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
758                 ldfld bool Tests/Integer::n
759                 ldc.i4.1
760                 ceq
761                 ret
762         }
763
764         .class nested private auto ansi sealed xxx
765         extends [mscorlib]System.ValueType
766    {
767      .field  public   object a
768
769      .method public hidebysig  specialname  rtspecialname 
770             instance default void .ctor ()  cil managed 
771      {
772                  .maxstack 8
773                  ret 
774      }
775    } // end of class xxx
776
777         .method public static int32 test_0_newobj_vtype () {
778                 .maxstack 6
779                 .locals init (
780                         valuetype Tests/xxx V_0
781                 )
782
783                 newobj instance void valuetype Tests/xxx::.ctor ()
784                 stloc.0
785                 ldloca.s 0
786                 ldfld object Tests/xxx::a
787                 brfalse OK
788                 ldc.i4.s 1
789                 ret
790         OK:
791                 ldc.i4.s 0
792                 ret
793         }
794
795         .method public static int32 test_1_filters () {
796                 .maxstack 16
797                 .locals init (
798                         int32 res
799                 )
800
801                 .try { // 0
802                         .try {
803                                 ldstr "OnErrorSub test Exception"
804                                 newobj instance void class [mscorlib]System.Exception::.ctor(string)
805                                 throw 
806                                 leave.s IL_0033
807                         }
808                         filter {
809                                 pop
810                                 ldc.i4.0
811                                 endfilter
812                         } {
813                                 pop
814                                 // Should not be called
815                                 ldc.i4.2
816                                 stloc res
817                                 leave.s IL_0033
818                         }
819                 }
820                 filter {
821                         pop
822                         ldc.i4.1
823                         endfilter 
824                 } {
825                   pop
826                   ldc.i4.1
827                   stloc res       
828                   leave.s IL_0033
829
830                 }
831                 IL_0033:
832                 ldloc res
833                 ret
834         }
835
836         .class nested private auto ansi sealed beforefieldinit TheStruct
837                 extends [mscorlib]System.ValueType {
838                 .field public int32 a
839                 .field public int32 b
840         }
841
842         .method public static int32 test_5_cpobj () {
843                 .maxstack 8
844                 .locals init (  
845                                 valuetype Tests/TheStruct v_0, 
846                                 valuetype Tests/TheStruct v_1
847                                          )
848
849                 ldloca v_0
850                 ldc.i4.2
851                 stfld int32 Tests/TheStruct::a
852
853                 ldloca v_0
854                 ldc.i4.3
855                 stfld int32 Tests/TheStruct::b
856
857                 ldloca v_1
858                 ldloca v_0
859                 cpobj Tests/TheStruct
860
861                 ldloca v_1
862                 ldfld int32 Tests/TheStruct::a
863                 ldloca v_1
864                 ldfld int32 Tests/TheStruct::b
865                 add
866
867                 ret
868         }
869
870         .method public static int32 test_5_ldobj_stloc_optimization () {
871                 .maxstack 8
872                 .locals init (  
873                                 valuetype Tests/TheStruct v_0, 
874                                 valuetype Tests/TheStruct v_1
875                                          )
876
877                 ldloca v_0
878                 ldc.i4.2
879                 stfld int32 Tests/TheStruct::a
880
881                 ldloca v_0
882                 ldc.i4.3
883                 stfld int32 Tests/TheStruct::b
884
885                 ldloca v_0
886                 ldobj valuetype Tests/TheStruct
887                 stloc.s v_1
888
889                 ldloca v_1
890                 ldfld int32 Tests/TheStruct::a
891                 ldloca v_1
892                 ldfld int32 Tests/TheStruct::b
893                 add
894
895                 ret
896         }
897
898         .method public static int32 test_1_cpobj_reference () {
899                 .maxstack 8
900                 .locals init (  
901                                 object v_0, 
902                                 object v_1
903                                          )
904
905                 newobj instance void object::.ctor()
906                 stloc v_0
907
908                 ldloca v_1
909                 ldloca v_0
910                 cpobj object
911
912                 ldloc v_0
913                 ldloc v_1
914                 ceq
915                 ret
916         }
917
918         .method public static int32 test_1_initobj_reference () {
919                 .maxstack 8
920                 .locals init (  
921                                 object v_0
922                                          )
923
924                 newobj instance void object::.ctor()
925                 stloc v_0
926
927                 ldloca v_0
928                 initobj object
929
930                 ldloc v_0
931                 ldnull
932                 ceq
933                 ret
934         }
935
936         .method public static int32 test_1_ldobj_reference () {
937                 .maxstack 8
938                 .locals init (  
939                                 object v_0
940                                          )
941
942                 newobj instance void object::.ctor()
943                 stloc v_0
944
945                 ldloc v_0
946                 ldloca v_0
947                 ldobj object
948                 ceq
949                 ret
950         }
951
952         .method public static int32 test_5_vtype_on_bb_boundary () {
953                 .maxstack 8
954                 .locals init (  
955                                 valuetype Tests/TheStruct v_0, 
956                                 valuetype Tests/TheStruct v_1
957                                          )
958
959                 ldloca v_0
960                 ldc.i4.2
961                 stfld int32 Tests/TheStruct::a
962
963                 ldloca v_0
964                 ldc.i4.3
965                 stfld int32 Tests/TheStruct::b
966
967                 ldloc v_0
968                 br L_0
969         L_0: stloc v_1
970
971                 ldloca v_1
972                 ldfld int32 Tests/TheStruct::a
973                 ldloca v_1
974                 ldfld int32 Tests/TheStruct::b
975                 add
976                 ret
977         }
978
979         .method public static int32 test_3_larray_get_set () {
980                 .locals init (
981                         int32[2]        V_0)
982                           
983                         ldc.i4.2 
984                         newobj instance void int32[0...]::.ctor(int32)
985                         stloc.0 
986                         ldloc.0 
987                         ldc.i4.0 
988                         ldc.i4 1
989                         call instance void int32[0...]::Set(int32, int32)
990                     ldloc.0 
991                     ldc.i4.1 
992                         ldc.i4 2
993                         call instance void int32[0...]::Set(int32, int32)
994
995                         ldloc.0
996                         ldc.i4.0
997                         call instance int32 int32[0...]::Get(int32)
998                         ldloc.0
999                         ldc.i4.1
1000                         call instance int32 int32[0...]::Get(int32)
1001                         add
1002                         ret
1003         }
1004
1005         .method public static void regalloc_regress_78314_helper (object o) cil managed
1006         {
1007                 ret
1008         }
1009
1010         .method public static int32 test_1_regalloc_regress_78314 () cil managed
1011         {
1012     // Code size       68 (0x44)
1013     .maxstack  6
1014     .locals init (int32 V_0, bool V_1)
1015     IL_0000:  ldc.i4.0
1016     IL_0001:  stloc.0
1017     IL_0002:  br.s       IL_003b
1018
1019     IL_0004:
1020     IL_001e:  ldc.i4.s   10
1021     IL_0020:  ldloc.0
1022     IL_0021:  shl
1023     IL_0022:  ldc.i4.s   10
1024     IL_0024:  ldloc.0
1025     IL_0025:  shl
1026     IL_0026:  ceq
1027     IL_0028:  box        [mscorlib]System.Boolean
1028     IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
1029     IL_0037:  ldloc.0
1030     IL_0038:  ldc.i4.1
1031     IL_0039:  add
1032     IL_003a:  stloc.0
1033     IL_003b:  ldloc.0
1034     IL_003c:  ldc.i4.8
1035     IL_003f:  blt.s      IL_0004
1036
1037         ldloc.0
1038         ldc.i4.8
1039         ceq
1040         conv.i4
1041         ret     
1042   }
1043
1044         .method public static void try_block_end_remove_if_useless () cil managed {
1045             .maxstack  8
1046
1047             T_START:
1048                 ldstr   "Start"
1049                         pop
1050                 leave.s COMPLETE
1051             T1_END:
1052
1053             COMPLETE:
1054                 ret
1055
1056             F1_START:
1057                 ldstr   "Finally1"
1058                         pop
1059                 endfinally
1060             F1_END:
1061
1062             .try T_START to T1_END finally handler F1_START to F1_END
1063         }
1064
1065         .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1066                 call void class Tests::try_block_end_remove_if_useless ()
1067                 ldc.i4.0
1068                 ret
1069         }
1070
1071    .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
1072     {
1073         ldc.i4.0
1074         switch (target)
1075         target: ldstr "bar"
1076                 pop
1077                 ldc.i4.0
1078         ret
1079     }
1080 }