2003-12-13 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / mini / iltests.il
index 4df34c9aaace7cd8ef7d0fe23bb5ac307b9baf10..dcbc6a766ab860811e8a9589ed5e663871008897 100644 (file)
                ret\r
        }\r
 \r
+       // make sure the register allocator works when the return value of\r
+       // 'div' is discarded\r
+       .method static public int32 test_0_div_regalloc () il managed {\r
+               .locals init (\r
+                       int32 i\r
+               )\r
+\r
+               ldloc 0\r
+               ldc.i4.s 0xa\r
+               div\r
+               pop\r
+               ldc.i4.0\r
+               ret\r
+       }\r
+\r
        .method static public int32 test_3_copy_used_bug () il managed {\r
 \r
                .locals init (\r
                ret\r
        }\r
 \r
+       .method public void inline_do_nothing () il managed {\r
+               ret\r
+       }\r
+       .method static public int32 test_1_checkthis_inlining () il managed {\r
+               ldnull\r
+               call instance void class Tests::inline_do_nothing ()\r
+               ldc.i4 1\r
+               ret\r
+       }\r
+\r
+       .class nested private auto ansi sealed beforefieldinit TailCallStruct \r
+               extends [mscorlib]System.ValueType {\r
+               .field public int32 a\r
+               .field public int32 b\r
+       }\r
+\r
+       .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {\r
+               ldarga 0\r
+               ldarga 0\r
+               ldfld int32 Tests/TailCallStruct::a\r
+               ldc.i4.1\r
+               add\r
+               stfld int32 Tests/TailCallStruct::a\r
+               ldarga 0\r
+               ldarga 0\r
+               ldfld int32 Tests/TailCallStruct::a\r
+               ldc.i4.2\r
+               add\r
+               stfld int32 Tests/TailCallStruct::a\r
+               ldarg.0\r
+               ret\r
+       }\r
+\r
+       .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {\r
+               ldarg.0\r
+               tail.\r
+               call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)\r
+               ret\r
+       }\r
+\r
+       .method static public int32 test_0_tail_calls () il managed {\r
+               .maxstack 16\r
+               .locals init (\r
+                       valuetype Tests/TailCallStruct arg\r
+               )\r
+               ldloca 0\r
+               ldc.i4.2\r
+               stfld int32 Tests/TailCallStruct::a\r
+               ldloca 0\r
+               ldc.i4.4\r
+               stfld int32 Tests/TailCallStruct::b\r
+               ldloc.0\r
+               call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)\r
+               stloc.0\r
+               ldloca 0\r
+               ldfld int32 Tests/TailCallStruct::a\r
+               ldloca 0\r
+               ldfld int32 Tests/TailCallStruct::b\r
+               add\r
+               ldc.i4 9\r
+               sub\r
+               ret\r
+       }\r
 }\r