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 .method static public int32 test_0_tail_calls () il managed {
492 valuetype Tests/TailCallStruct arg
496 stfld int32 Tests/TailCallStruct::a
499 stfld int32 Tests/TailCallStruct::b
501 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
504 ldfld int32 Tests/TailCallStruct::a
506 ldfld int32 Tests/TailCallStruct::b
513 .method static public int32 tail3 (int32 i, int32 j) il managed {
520 .method static public int32 tail4 (int32 i, int32 j) il managed {
525 // Test arg0 allocated to a register
535 // Test switched up argument variables as the actual arguments
539 call int32 Tests::tail3 (int32, int32)
543 .method static public int32 test_24_tail_calls2 () il managed {
556 call int32 Tests::tail4 (int32, int32)
560 .method public static int32 test_5_jmp () cil managed {
563 call int32 Tests::jmp2 (int32, int32)
567 .method public static int32 jmp2 (int32, int32) cil managed {
576 jmp int32 Tests::jmp3 (int32, int32)
581 .method public static int32 jmp3 (int32 i, int32 j) cil managed {
588 .method static public int32 test_11_switch_with_nonempty_stack () il managed {
603 .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
617 .method public static int32 test_0_conv_ovf_i8_neg () il managed {
632 .method public static int32 test_1234_conv_u4 () cil managed {
641 .method public static int32 test_0_conv_ovf_i_un () cil managed {
660 sizeof [mscorlib]System.IntPtr
667 } catch [mscorlib]System.OverflowException {
679 .method public static int32 test_0_conv_ovf_u_un () cil managed {
694 .method public static int32 test_0_conv_ovf_i () cil managed {
709 .method public static int32 test_0_conv_ovf_u () cil managed {
724 .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
733 .method public static int32 test_0_lconv_ovf_i () cil managed {
749 .method public static int32 test_0_lconv_ovf_u () cil managed {
765 .method public static int32 test_0_lconv_ovf_i_un () cil managed {
781 .method public static int32 test_0_lconv_ovf_u_un () cil managed {
797 .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
813 .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
815 .locals init (int32 res)
832 } catch [mscorlib]System.OverflowException {
840 ldc.i8 0xffffffff80000000
846 } catch [mscorlib]System.OverflowException {
856 .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
858 .locals init (int32 res)
870 .method public static int32 test_32_lconv_to_u8 () cil managed
881 .method public static int32 test_32_lconv_to_i8 () cil managed
892 .method public static int32 test_15_lconv_to_u () cil managed
900 #if !defined(__ppc__) && !defined(__powerpc__)
901 // PPC handles overflow by clipping, but this test assumes
902 // no overflow handling. According to ECMA the result of
903 // float->int conversion is undefined if overflow occurs, so
904 // both behaviours are valid.
905 .method public static int32 test_0_fconv_to_i () cil managed {
921 .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed
928 ldtoken [mscorlib]System.String
931 ldtoken [mscorlib]System.Object
933 call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
934 callvirt instance string class [mscorlib]System.Type::get_FullName ()
935 ldstr "System.String"
936 callvirt instance bool class [mscorlib]System.Object::Equals(object)
942 .method public static int32 test_0_bug59580 ()
944 ldc.r4 float32(0x7FC00000)
945 ldc.r4 float32(0x7FC00000)
956 .method public static int32 test_1_bug60056 () {
957 .locals init (int32 m5)
975 .method public static int32 test_1_conv_u8_cfold () {
979 ldc.i8 0x00000000ffffffff
985 .method public static int32 test_1_array_type_mismatch_ldelema () {
986 .locals init (int32 r)
1002 } catch [mscorlib]System.ArrayTypeMismatchException {
1013 .method public static int32 test_1_conv_ovf_i8_with_i4 () {
1022 .method public static int32 test_0_initlocals_float_ptr () {
1026 float32& pinned V_1,
1029 newarr [mscorlib]System.Single
1037 ldelema [mscorlib]System.Single
1047 .method public static int32 test_7_conv_ovf_u8_un () {
1049 .locals init (unsigned int64)
1059 .method public static int32 test_1_bug_74591 () {
1061 .locals init (int32)
1074 .class nested public auto ansi Integer
1075 extends [mscorlib]System.Object {
1077 .field public bool n
1079 .method public hidebysig specialname rtspecialname
1080 instance default void .ctor (unsigned int64 i, bool n) cil managed
1084 call instance void class [mscorlib]System.Object::.ctor()
1087 stfld bool Tests/Integer::n
1092 .method public static int32 test_1_bug_74726 () {
1101 newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
1102 ldfld bool Tests/Integer::n
1108 .class nested private auto ansi sealed xxx
1109 extends [mscorlib]System.ValueType
1111 .field public object a
1113 .method public hidebysig specialname rtspecialname
1114 instance default void .ctor () cil managed
1119 } // end of class xxx
1121 .method public static int32 test_0_newobj_vtype () {
1124 valuetype Tests/xxx V_0
1127 newobj instance void valuetype Tests/xxx::.ctor ()
1130 ldfld object Tests/xxx::a
1139 .method public static int32 test_0_newobj_vtype_primitive () {
1146 newobj instance void native int::'.ctor'(int32)
1158 .method public static int32 test_1_filters () {
1166 ldstr "OnErrorSub test Exception"
1167 newobj instance void class [mscorlib]System.Exception::.ctor(string)
1177 // Should not be called
1199 .class nested private auto ansi sealed beforefieldinit TheStruct
1200 extends [mscorlib]System.ValueType {
1201 .field public int32 a
1202 .field public int32 b
1205 .method public static int32 test_5_cpobj () {
1208 valuetype Tests/TheStruct v_0,
1209 valuetype Tests/TheStruct v_1
1214 stfld int32 Tests/TheStruct::a
1218 stfld int32 Tests/TheStruct::b
1222 cpobj Tests/TheStruct
1225 ldfld int32 Tests/TheStruct::a
1227 ldfld int32 Tests/TheStruct::b
1233 .method public static int32 test_5_ldobj_stloc_optimization () {
1236 valuetype Tests/TheStruct v_0,
1237 valuetype Tests/TheStruct v_1
1242 stfld int32 Tests/TheStruct::a
1246 stfld int32 Tests/TheStruct::b
1249 ldobj valuetype Tests/TheStruct
1253 ldfld int32 Tests/TheStruct::a
1255 ldfld int32 Tests/TheStruct::b
1261 .method public static int32 test_1_cpobj_reference () {
1268 newobj instance void object::.ctor()
1281 .method public static int32 test_1_initobj_reference () {
1287 newobj instance void object::.ctor()
1299 .method public static int32 test_1_ldobj_reference () {
1305 newobj instance void object::.ctor()
1315 .method public static int32 test_5_vtype_on_bb_boundary () {
1318 valuetype Tests/TheStruct v_0,
1319 valuetype Tests/TheStruct v_1
1324 stfld int32 Tests/TheStruct::a
1328 stfld int32 Tests/TheStruct::b
1335 ldfld int32 Tests/TheStruct::a
1337 ldfld int32 Tests/TheStruct::b
1342 .method public static int32 test_5_different_in_stacks () cil managed {
1366 .method public static int32 test_3_larray_get_set () {
1371 newobj instance void int32[0...]::.ctor(int32)
1376 call instance void int32[0...]::Set(int32, int32)
1380 call instance void int32[0...]::Set(int32, int32)
1384 call instance int32 int32[0...]::Get(int32)
1387 call instance int32 int32[0...]::Get(int32)
1392 .method public static int32 test_0_pop_side_effects () {
1401 catch [mscorlib]System.ArithmeticException {
1413 .method public static void regalloc_regress_78314_helper (object o) cil managed
1418 .method public static int32 test_1_regalloc_regress_78314 () cil managed
1420 // Code size 68 (0x44)
1422 .locals init (int32 V_0, bool V_1)
1425 IL_0002: br.s IL_003b
1428 IL_001e: ldc.i4.s 10
1431 IL_0022: ldc.i4.s 10
1435 IL_0028: box [mscorlib]System.Boolean
1436 IL_0032: call void Tests::regalloc_regress_78314_helper(object)
1443 IL_003f: blt.s IL_0004
1452 .method public static void try_block_end_remove_if_useless () cil managed {
1470 .try T_START to T1_END finally handler F1_START to F1_END
1473 .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
1474 call void class Tests::try_block_end_remove_if_useless ()
1479 .method private static int32 test_0_regress_78629_switch_next_ins_target () cil managed
1489 // This belongs to basic-float.cs, but its hard to tell mcs/csc to
1490 // generate the non .un version of the opcodes
1491 .method private static hidebysig
1492 default int32 test_4_float_branch_nan () cil managed
1494 // Method begins at RVA 0x27a4
1495 // Code size 74 (0x4a)
1501 IL_0000: ldc.r8 (00 00 00 00 00 00 f8 ff)
1509 IL_0018: bge.s IL_001a
1521 IL_0022: ble.s IL_002e
1532 IL_0036: blt.s IL_0038
1543 IL_0040: bgt.s IL_0042
1554 } // end of method Tests::test_5_float_branch_nan
1556 .method private static hidebysig
1557 default void regress_80622_inner (object x) cil managed
1559 .locals (unsigned int8 i)
1560 // Method begins at RVA 0x2050
1561 // Code size 14 (0xe)
1564 IL_1001: unbox unsigned int8
1565 IL_1006: ldobj unsigned int8
1566 IL_000b: conv.ovf.i4.un
1572 .method private static hidebysig
1573 default int32 test_0_regress_80622 () cil managed
1577 IL_0005: box unsigned int8
1578 IL_000a: call void class Tests::regress_80622_inner (object)
1583 .method private static default int32 test_0_regresss_80190 () cil managed
1586 .locals init (int32 V_0,
1590 IL_0002: ldloca.s V_0
1601 .class interface nested public auto ansi abstract IFaceWithStaticMethod
1603 .method public static specialname
1604 default void foo () cil managed noinlining
1611 .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
1613 .method public hidebysig specialname rtspecialname
1614 instance default void .ctor () cil managed
1622 // Test that static methods in interfaces are ignored during vtable construction
1623 .method private static default int32 test_0_ifaces_with_static_methods () cil managed
1627 newobj instance void class Tests/AClass::.ctor()
1633 .method private static hidebysig default int32 Foo<T> (!!T n) cil managed {
1644 .method static public int32 test_0_nullable_box_brtrue () cil managed {
1646 .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
1649 call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
1654 .method static public int32 test_0_ldelema_type_check () cil managed {
1656 .locals init (object[] V_0,
1668 } catch [mscorlib]System.ArrayTypeMismatchException {
1682 } catch [mscorlib]System.ArrayTypeMismatchException {
1694 readonly. ldelema object
1696 } catch [mscorlib]System.ArrayTypeMismatchException {
1720 .method static public int32 test_0_array_address_type_check () cil managed {
1722 .locals init (object[] V_0,
1727 newobj instance void object[,]::.ctor(int32, int32)
1734 call instance object& object[,]::Address(int32, int32)
1736 } catch [mscorlib]System.ArrayTypeMismatchException {
1743 newobj instance void string[,]::.ctor(int32, int32)
1750 call instance object& object[,]::Address(int32, int32)
1752 } catch [mscorlib]System.ArrayTypeMismatchException {
1759 newobj instance void string[,]::.ctor(int32, int32)
1766 readonly. call instance object& object[,]::Address(int32, int32)
1768 } catch [mscorlib]System.ArrayTypeMismatchException {
1788 .field public static unsigned int64 'ull'
1790 .field public static int32 'shift2'
1792 .method public static int32 test_0_long_shift_regalloc () cil managed
1794 .locals (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
1798 ldc.i8 81985529234382576
1799 stsfld unsigned int64 Tests::ull
1801 stsfld int32 Tests::shift2
1803 ldsfld unsigned int64 Tests::ull
1805 ldsfld int32 Tests::shift2
1816 ldc.i8 1311768467750121216
1824 // Test calling ldfld directly on a vtype instead of a vtype address
1825 .method public static int32 test_5_call_ldfld_vtype () cil managed
1829 valuetype Tests/TailCallStruct arg
1833 stfld int32 Tests/TailCallStruct::a
1836 stfld int32 Tests/TailCallStruct::b
1838 call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
1839 ldfld int32 Tests/TailCallStruct::a
1843 .method public static int32 throw_ret () cil managed
1846 newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
1852 .method public static int32 throw2_ret () cil managed
1859 call int32 Tests::throw_ret ()
1863 // Test inlining a method which contains just a throw
1864 .method public static int32 test_0_inline_throw () cil managed
1872 call int32 Tests::throw2_ret ()
1875 } catch [mscorlib]System.OverflowException {
1888 .method public static int32 test_0_stelem_any_null_opt () cil managed
1896 newarr [mscorlib]System.Object
1907 stelem.any [mscorlib]System.Object
1922 .method public static hidebysig
1923 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
1925 // Method begins at RVA 0x20f4
1926 // Code size 44 (0x2c)
1960 } // end of method main::callee
1963 .method public static hidebysig
1964 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
1966 // Method begins at RVA 0x2124
1967 // Code size 34 (0x22)
1986 IL_001c: call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
1988 } // end of method main::caller
1991 .method public static hidebysig
1992 default int32 test_0_many_args_tail_call () cil managed
1994 // Method begins at RVA 0x2154
1995 // Code size 43 (0x2b)
2005 IL_0008: ldc.i4.s 0x09
2006 IL_000a: ldc.i4.s 0x0a
2007 IL_000c: ldc.i4.s 0x0b
2008 IL_000e: ldc.i4.s 0x0c
2009 IL_0010: ldc.i4.s 0x0d
2010 IL_0012: ldc.i4.s 0x0e
2011 IL_0014: ldc.i4.s 0x0f
2012 IL_0016: ldc.i4.s 0x10
2013 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)
2015 IL_0022: beq IL_0029
2021 } // end of method main::Main
2023 .class nested private auto ansi beforefieldinit R1
2024 extends [mscorlib]System.MarshalByRefObject
2026 .field public int32 test_field
2028 .method public hidebysig specialname rtspecialname
2029 instance default void '.ctor' () cil managed
2035 .method public static hidebysig
2036 default int32 return_0 () cil managed
2042 .method public static hidebysig
2043 default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
2049 newobj instance void class Tests/R1::.ctor ()
2054 stfld int32 Tests/R1::test_field
2055 call int32 class Tests::return_0 ()
2061 .method public static default int32 return_2 () cil managed
2071 .method public static hidebysig
2072 default int32 test_1_cmov_opt_regress_463357 () cil managed
2074 call int32 class Tests::return_2 ()
2087 .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1) cil managed
2090 .locals init (int32 V_0, bool V_1, bool V_2)
2099 IL_001f: brfalse IL_0036
2116 .method public static default int32 test_0_cmov_opt_regress_474718 () cil managed
2120 call int32 Tests::cmov_opt_regress_474718_inner (int32)
2124 .method public static default int32 test_5_createarr_newobj () cil managed
2129 newobj void char[]::.ctor(int32)
2134 .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
2137 .locals init (native int)
2143 // Set the first value to 3
2150 // Zero out the first 3 values
2156 // Load the first value
2165 .method public static float32 GetFloat32() cil managed noinlining
2168 ldc.r8 0.19975845134874831
2172 /* Disabled until they can be fixed to run on amd64
2173 .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
2177 call float32 Tests::GetFloat32()
2178 ldc.r8 0.19975845134874831