2 .assembly extern TestDriver {}
3 .assembly extern mscorlib {}
5 .class public auto ansi sealed beforefieldinit Tests {
7 .method static public int32 Main(string[] args) il managed {
11 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
13 call int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type, string[])
17 // make sure the register allocator works when the return value of
19 .method static public int32 test_0_div_regalloc () il managed {
33 .method static public int32 test_1_ceq_to_i4 () il managed {
47 .method static public int32 test_3_shl_regvars () il managed {
94 .method static public int32 test_1_fceq_to_i4 () il managed {
114 // This should be manually checked. Basically under -O=linears,
115 // you should not see tons of register spilling.
117 .method static public int32 test_1_bytedreg_free () il managed {
153 // This should be manually checked. Basically under -O=linears,
154 // you should not see tons of register spilling.
156 .method static public int32 test_0_bytesreg1_free () il managed {
195 .method static public int32 test_1_shift_regvar () il managed {
216 // this only happens with the managed pointer, not an unmanaged one.
217 .method static public int32 test_0_foo () il managed {
234 .method static public int32 test_0_localloc () cil managed {
235 .locals init (native int, native int, native int, native int, int32)
260 // Check zero initialized
309 // Try allocations bigger than one page
335 .method private static void do_localloc () cil managed {
340 IL_0001: ldc.i4 131072
347 // Check that localloc can't be inlined
348 .method static public int32 test_0_localloc_inline () cil managed {
358 START: call void class Tests::do_localloc()
371 .method static public int32 test_3_copy_used_bug () il managed {
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 {
425 .method static public void do_nothing (int32 a) il managed {
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 {
441 call void class Tests::do_nothing (int32)
449 .method public void inline_do_nothing () il managed {
452 .method static public int32 test_1_checkthis_inlining () il managed {
454 call instance void class Tests::inline_do_nothing ()
459 .class nested private auto ansi sealed beforefieldinit TailCallStruct
460 extends [mscorlib]System.ValueType {
461 .field public int32 a
462 .field public int32 b
465 .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
468 ldfld int32 Tests/TailCallStruct::a
471 stfld int32 Tests/TailCallStruct::a
474 ldfld int32 Tests/TailCallStruct::a
477 stfld int32 Tests/TailCallStruct::a
482 .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
485 call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
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
496 .method static valuetype Tests/TailCallStructBig tail1_big (valuetype Tests/TailCallStructBig arg) {
499 ldfld int32 Tests/TailCallStructBig::a
502 stfld int32 Tests/TailCallStructBig::a
507 .method static valuetype Tests/TailCallStructBig tail2_big (valuetype Tests/TailCallStructBig arg) {
510 call valuetype Tests/TailCallStructBig Tests::tail1_big (valuetype Tests/TailCallStructBig)
514 .method static public int32 test_0_tail_calls () il managed {
517 valuetype Tests/TailCallStruct arg,
518 valuetype Tests/TailCallStructBig arg2
522 stfld int32 Tests/TailCallStruct::a
525 stfld int32 Tests/TailCallStruct::b
527 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
532 stfld int32 Tests/TailCallStructBig::a
534 call valuetype Tests/TailCallStructBig Tests::tail2_big (valuetype Tests/TailCallStructBig)
538 ldfld int32 Tests/TailCallStruct::a
540 ldfld int32 Tests/TailCallStruct::b
543 ldfld int32 Tests/TailCallStructBig::a
550 .method static public int32 tail3 (int32 i, int32 j) il managed {
557 .method static public int32 tail4 (int32 i, int32 j) il managed {
562 // Test arg0 allocated to a register
572 // Test switched up argument variables as the actual arguments
576 call int32 Tests::tail3 (int32, int32)
580 .method static public int32 test_24_tail_calls2 () il managed {
593 call int32 Tests::tail4 (int32, int32)
597 .method public static int32 test_5_jmp () cil managed {
600 call int32 Tests::jmp2 (int32, int32)
604 .method public static int32 jmp2 (int32, int32) cil managed {
613 jmp int32 Tests::jmp3 (int32, int32)
618 .method public static int32 jmp3 (int32 i, int32 j) cil managed {
625 .method static public int32 test_11_switch_with_nonempty_stack () il managed {
640 .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
654 .method public static int32 test_0_conv_ovf_i8_neg () il managed {
669 .method public static int32 test_1234_conv_u4 () cil managed {
678 .method public static int32 test_0_conv_ovf_i_un () cil managed {
697 sizeof [mscorlib]System.IntPtr
704 } catch [mscorlib]System.OverflowException {
716 .method public static int32 test_0_conv_ovf_u_un () cil managed {
731 .method public static int32 test_0_conv_ovf_i () cil managed {
746 .method public static int32 test_0_conv_ovf_u () cil managed {
761 .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
770 .method public static int32 test_0_lconv_ovf_i () cil managed {
786 .method public static int32 test_0_lconv_ovf_u () cil managed {
802 .method public static int32 test_0_lconv_ovf_i_un () cil managed {
818 .method public static int32 test_0_lconv_ovf_u_un () cil managed {
834 .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
850 .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
852 .locals init (int32 res)
869 } catch [mscorlib]System.OverflowException {
877 ldc.i8 0xffffffff80000000
883 } catch [mscorlib]System.OverflowException {
893 .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
895 .locals init (int32 res)
907 .method public static int32 test_32_lconv_to_u8 () cil managed
918 .method public static int32 test_32_lconv_to_i8 () cil managed
929 .method public static int32 test_15_lconv_to_u () cil managed
937 #if !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__)
938 // PPC handles overflow by clipping, but this test assumes
939 // no overflow handling. According to ECMA the result of
940 // float->int conversion is undefined if overflow occurs, so
941 // both behaviours are valid.
942 .method public static int32 test_0_fconv_to_i () cil managed {
958 .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed
965 ldtoken [mscorlib]System.String
968 ldtoken [mscorlib]System.Object
970 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
971 callvirt instance string class [mscorlib]System.Type::get_FullName ()
972 ldstr "System.String"
973 callvirt instance bool class [mscorlib]System.Object::Equals(object)
979 .method public static int32 test_0_bug59580 ()
981 ldc.r4 float32(0x7FC00000)
982 ldc.r4 float32(0x7FC00000)
993 .method public static int32 test_1_bug60056 () {
994 .locals init (int32 m5)
1012 .method public static int32 test_1_conv_u8_cfold () {
1016 ldc.i8 0x00000000ffffffff
1022 .method public static int32 test_1_array_type_mismatch_ldelema () {
1023 .locals init (int32 r)
1039 } catch [mscorlib]System.ArrayTypeMismatchException {
1050 .method public static int32 test_1_conv_ovf_i8_with_i4 () {
1059 .method public static int32 test_0_initlocals_float_ptr () {
1063 float32& pinned V_1,
1066 newarr [mscorlib]System.Single
1074 ldelema [mscorlib]System.Single
1084 .method public static int32 test_7_conv_ovf_u8_un () {
1086 .locals init (unsigned int64)
1096 .method public static int32 test_1_bug_74591 () {
1098 .locals init (int32)
1111 .class nested public auto ansi Integer
1112 extends [mscorlib]System.Object {
1114 .field public bool n
1116 .method public hidebysig specialname rtspecialname
1117 instance default void .ctor (unsigned int64 i, bool n) cil managed
1121 call instance void class [mscorlib]System.Object::.ctor()
1124 stfld bool Tests/Integer::n
1129 .method public static int32 test_1_bug_74726 () {
1138 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
1139 ldfld bool Tests/Integer::n
1145 .class nested private auto ansi sealed xxx
1146 extends [mscorlib]System.ValueType
1148 .field public object a
1150 .method public hidebysig specialname rtspecialname
1151 instance default void .ctor () cil managed
1156 } // end of class xxx
1158 .method public static int32 test_0_newobj_vtype () {
1161 valuetype Tests/xxx V_0
1164 newobj instance void valuetype Tests/xxx::.ctor ()
1167 ldfld object Tests/xxx::a
1176 .method public static int32 test_0_newobj_vtype_primitive () {
1183 newobj instance void native int::'.ctor'(int32)
1195 .method public static int32 test_1_filters () {
1203 ldstr "OnErrorSub test Exception"
1204 newobj instance void class [mscorlib]System.Exception::.ctor(string)
1214 // Should not be called
1236 .class nested private auto ansi sealed beforefieldinit TheStruct
1237 extends [mscorlib]System.ValueType {
1238 .field public int32 a
1239 .field public int32 b
1242 .method public static int32 test_5_cpobj () {
1245 valuetype Tests/TheStruct v_0,
1246 valuetype Tests/TheStruct v_1
1251 stfld int32 Tests/TheStruct::a
1255 stfld int32 Tests/TheStruct::b
1259 cpobj Tests/TheStruct
1262 ldfld int32 Tests/TheStruct::a
1264 ldfld int32 Tests/TheStruct::b
1270 .method public static int32 test_5_ldobj_stloc_optimization () {
1273 valuetype Tests/TheStruct v_0,
1274 valuetype Tests/TheStruct v_1
1279 stfld int32 Tests/TheStruct::a
1283 stfld int32 Tests/TheStruct::b
1286 ldobj valuetype Tests/TheStruct
1290 ldfld int32 Tests/TheStruct::a
1292 ldfld int32 Tests/TheStruct::b
1298 .method public static int32 test_1_cpobj_reference () {
1305 newobj instance void object::.ctor()
1318 .method public static int32 test_1_initobj_reference () {
1324 newobj instance void object::.ctor()
1336 .method public static int32 test_1_ldobj_reference () {
1342 newobj instance void object::.ctor()
1352 .method public static int32 test_5_vtype_on_bb_boundary () {
1355 valuetype Tests/TheStruct v_0,
1356 valuetype Tests/TheStruct v_1
1361 stfld int32 Tests/TheStruct::a
1365 stfld int32 Tests/TheStruct::b
1372 ldfld int32 Tests/TheStruct::a
1374 ldfld int32 Tests/TheStruct::b
1379 .method public static int32 test_5_different_in_stacks () cil managed {
1403 .method public static int32 test_3_larray_get_set () {
1408 newobj instance void int32[0...]::.ctor(int32)
1413 call instance void int32[0...]::Set(int32, int32)
1417 call instance void int32[0...]::Set(int32, int32)
1421 call instance int32 int32[0...]::Get(int32)
1424 call instance int32 int32[0...]::Get(int32)
1429 .method public static int32 test_0_pop_side_effects () {
1438 catch [mscorlib]System.ArithmeticException {
1450 .method public static void regalloc_regress_78314_helper (object o) cil managed
1455 .method public static int32 test_1_regalloc_regress_78314 () cil managed
1457 // Code size 68 (0x44)
1459 .locals init (int32 V_0, bool V_1)
1462 IL_0002: br.s IL_003b
1465 IL_001e: ldc.i4.s 10
1468 IL_0022: ldc.i4.s 10
1472 IL_0028: box [mscorlib]System.Boolean
1473 IL_0032: call void Tests::regalloc_regress_78314_helper(object)
1480 IL_003f: blt.s IL_0004
1489 .method public static void try_block_end_remove_if_useless () cil managed {
1507 .try T_START to T1_END finally handler F1_START to F1_END
1510 .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1511 call void class Tests::try_block_end_remove_if_useless ()
1516 .method private static int32 test_0_regress_78629_switch_next_ins_target () cil managed
1526 // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1527 // generate the non .un version of the opcodes
1528 .method private static hidebysig
1529 default int32 test_4_float_branch_nan () cil managed
1531 // Method begins at RVA 0x27a4
1532 // Code size 74 (0x4a)
1538 IL_0000: ldc.r8 (00 00 00 00 00 00 f8 ff)
1546 IL_0018: bge.s IL_001a
1558 IL_0022: ble.s IL_002e
1569 IL_0036: blt.s IL_0038
1580 IL_0040: bgt.s IL_0042
1591 } // end of method Tests::test_5_float_branch_nan
1593 .method private static hidebysig
1594 default void regress_80622_inner (object x) cil managed
1596 .locals (unsigned int8 i)
1597 // Method begins at RVA 0x2050
1598 // Code size 14 (0xe)
1601 IL_1001: unbox unsigned int8
1602 IL_1006: ldobj unsigned int8
1603 IL_000b: conv.ovf.i4.un
1609 .method private static hidebysig
1610 default int32 test_0_regress_80622 () cil managed
1614 IL_0005: box unsigned int8
1615 IL_000a: call void class Tests::regress_80622_inner (object)
1620 .method private static default int32 test_0_regresss_80190 () cil managed
1623 .locals init (int32 V_0,
1627 IL_0002: ldloca.s V_0
1638 .class interface nested public auto ansi abstract IFaceWithStaticMethod
1640 .method public static specialname
1641 default void foo () cil managed noinlining
1648 .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1650 .method public hidebysig specialname rtspecialname
1651 instance default void .ctor () cil managed
1659 // Test that static methods in interfaces are ignored during vtable construction
1660 .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1664 newobj instance void class Tests/AClass::.ctor()
1670 .method private static hidebysig default int32 Foo<T> (!!T n) cil managed {
1681 .method static public int32 test_0_nullable_box_brtrue () cil managed {
1683 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1686 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1691 .method static public int32 test_0_ldelema_type_check () cil managed {
1693 .locals init (object[] V_0,
1705 } catch [mscorlib]System.ArrayTypeMismatchException {
1719 } catch [mscorlib]System.ArrayTypeMismatchException {
1731 readonly. ldelema object
1733 } catch [mscorlib]System.ArrayTypeMismatchException {
1757 .method static public int32 test_0_array_address_type_check () cil managed {
1759 .locals init (object[] V_0,
1764 newobj instance void object[,]::.ctor(int32, int32)
1771 call instance object& object[,]::Address(int32, int32)
1773 } catch [mscorlib]System.ArrayTypeMismatchException {
1780 newobj instance void string[,]::.ctor(int32, int32)
1787 call instance object& object[,]::Address(int32, int32)
1789 } catch [mscorlib]System.ArrayTypeMismatchException {
1796 newobj instance void string[,]::.ctor(int32, int32)
1803 readonly. call instance object& object[,]::Address(int32, int32)
1805 } catch [mscorlib]System.ArrayTypeMismatchException {
1825 .field public static unsigned int64 'ull'
1827 .field public static int32 'shift2'
1829 .method public static int32 test_0_long_shift_regalloc () cil managed
1831 .locals (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
1835 ldc.i8 81985529234382576
1836 stsfld unsigned int64 Tests::ull
1838 stsfld int32 Tests::shift2
1840 ldsfld unsigned int64 Tests::ull
1842 ldsfld int32 Tests::shift2
1853 ldc.i8 1311768467750121216
1861 // Test calling ldfld directly on a vtype instead of a vtype address
1862 .method public static int32 test_5_call_ldfld_vtype () cil managed
1866 valuetype Tests/TailCallStruct arg
1870 stfld int32 Tests/TailCallStruct::a
1873 stfld int32 Tests/TailCallStruct::b
1875 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
1876 ldfld int32 Tests/TailCallStruct::a
1880 .method public static int32 throw_ret () cil managed
1883 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
1889 .method public static int32 throw2_ret () cil managed
1896 call int32 Tests::throw_ret ()
1900 // Test inlining a method which contains just a throw
1901 .method public static int32 test_0_inline_throw () cil managed
1909 call int32 Tests::throw2_ret ()
1912 } catch [mscorlib]System.OverflowException {
1925 .method public static int32 test_0_stelem_any_null_opt () cil managed
1933 newarr [mscorlib]System.Object
1944 stelem.any [mscorlib]System.Object
1959 .method public static hidebysig
1960 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
1962 // Method begins at RVA 0x20f4
1963 // Code size 44 (0x2c)
1997 } // end of method main::callee
2000 .method public static hidebysig
2001 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
2003 // Method begins at RVA 0x2124
2004 // Code size 34 (0x22)
2023 IL_001c: call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
2025 } // end of method main::caller
2028 .method public static hidebysig
2029 default int32 test_0_many_args_tail_call () cil managed
2031 // Method begins at RVA 0x2154
2032 // Code size 43 (0x2b)
2042 IL_0008: ldc.i4.s 0x09
2043 IL_000a: ldc.i4.s 0x0a
2044 IL_000c: ldc.i4.s 0x0b
2045 IL_000e: ldc.i4.s 0x0c
2046 IL_0010: ldc.i4.s 0x0d
2047 IL_0012: ldc.i4.s 0x0e
2048 IL_0014: ldc.i4.s 0x0f
2049 IL_0016: ldc.i4.s 0x10
2050 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)
2052 IL_0022: beq IL_0029
2058 } // end of method main::Main
2060 .class nested private auto ansi beforefieldinit R1
2061 extends [mscorlib]System.MarshalByRefObject
2063 .field public int32 test_field
2065 .method public hidebysig specialname rtspecialname
2066 instance default void '.ctor' () cil managed
2072 .method public static hidebysig
2073 default int32 return_0 () cil managed
2079 .method public static hidebysig
2080 default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2086 newobj instance void class Tests/R1::.ctor ()
2091 stfld int32 Tests/R1::test_field
2092 call int32 class Tests::return_0 ()
2098 .method public static default int32 return_2 () cil managed
2108 .method public static hidebysig
2109 default int32 test_1_cmov_opt_regress_463357 () cil managed
2111 call int32 class Tests::return_2 ()
2124 .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1) cil managed
2127 .locals init (int32 V_0, bool V_1, bool V_2)
2136 IL_001f: brfalse IL_0036
2153 .method public static default int32 test_0_cmov_opt_regress_474718 () cil managed
2157 call int32 Tests::cmov_opt_regress_474718_inner (int32)
2161 .method public static default int32 test_5_createarr_newobj () cil managed
2166 newobj void char[]::.ctor(int32)
2171 .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
2174 .locals init (native int)
2180 // Set the first value to 3
2187 // Zero out the first 3 values
2193 // Load the first value
2202 .method public static float32 GetFloat32() cil managed noinlining
2205 ldc.r8 0.19975845134874831
2209 /* Disabled until they can be fixed to run on amd64
2210 .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
2214 call float32 Tests::GetFloat32()
2215 ldc.r8 0.19975845134874831