3 using System.Reflection;
4 using System.Runtime.InteropServices;
5 using System.Runtime.CompilerServices;
8 * Regression tests for the mono JIT.
10 * Each test needs to be of the form:
12 * static int test_<result>_<name> ();
14 * where <result> is an integer (the value that needs to be returned by
15 * the method to make it pass.
16 * <name> is a user-displayed name used to identify the test.
18 * The tests can be driven in two ways:
19 * *) running the program directly: Main() uses reflection to find and invoke
20 * the test methods (this is useful mostly to check that the tests are correct)
21 * *) with the --regression switch of the jit (this is the preferred way since
22 * all the tests will be run with optimizations on and off)
24 * The reflection logic could be moved to a .dll since we need at least another
25 * regression test file written in IL code to have better control on how
64 public void populate ()
74 return one == 1 && two == 2 &&
75 three == 3 && four == 4 &&
76 five == 5 && six == 6 &&
77 seven == 7 && eight == 8 &&
78 nine == 9 && ten == 10;
84 public Sample (int v) {
89 [StructLayout ( LayoutKind.Explicit )]
90 struct StructWithBigOffsets {
91 [ FieldOffset(10000) ] public byte b;
92 [ FieldOffset(10001) ] public sbyte sb;
93 [ FieldOffset(11000) ] public short s;
94 [ FieldOffset(11002) ] public ushort us;
95 [ FieldOffset(12000) ] public uint i;
96 [ FieldOffset(12004) ] public int si;
97 [ FieldOffset(13000) ] public long l;
98 [ FieldOffset(14000) ] public float f;
99 [ FieldOffset(15000) ] public double d;
109 public long a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;
113 public Alpha a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;
117 public Beta a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;
123 public static int Main (string[] args) {
124 return TestDriver.RunTests (typeof (Tests), args);
128 public static int test_0_return () {
132 s.c = (short)(s.a + s.b);
137 public static int test_0_string_access () {
144 public static int test_0_string_virtual_call () {
146 string s2 = s.ToString ();
152 public static int test_0_iface_call () {
154 object o = ((ICloneable)s).Clone ();
158 public static int test_5_newobj () {
159 Sample s = new Sample (5);
163 public static int test_4_box () {
168 public static int test_0_enum_unbox () {
169 SampleEnum x = SampleEnum.A;
179 static Simple get_simple (int v) {
180 Simple r = new Simple ();
183 r.c = (short)(v + 2);
189 public static int test_3_return_struct () {
190 Simple v = get_simple (1);
203 public virtual Simple v_get_simple (int v)
205 return get_simple (v);
208 public static int test_2_return_struct_virtual () {
209 Tests t = new Tests ();
210 Simple v = t.v_get_simple (2);
223 static int receive_simple (int a, Simple v, int b) {
239 public static int test_5_pass_struct () {
240 Simple v = get_simple (1);
241 if (receive_simple (7, v, 9) != 0)
243 if (receive_simple (7, get_simple (1), 9) != 0)
249 public static int test_5_pass_static_struct () {
250 s_v = get_simple (1);
251 if (receive_simple (7, s_v, 9) != 0)
256 // Test alignment of small structs
258 static Small get_small (byte v) {
259 Small r = new Small ();
262 r.b2 = (byte)(v + 1);
267 static Small return_small (Small s) {
271 static int receive_small (int a, Small v, int b) {
279 static int receive_small_sparc_many_args (int a, int a2, int a3, int a4, int a5, int a6, Small v, int b) {
287 public static int test_5_pass_small_struct () {
288 Small v = get_small (1);
289 if (receive_small (7, v, 9) != 0)
291 if (receive_small (7, get_small (1), 9) != 0)
293 if (receive_small_sparc_many_args (1, 2, 3, 4, 5, 6, v, 9) != 0)
295 v = return_small (v);
303 // 64-bits, 32-bit aligned
309 static int check_struct1(struct1 x) {
317 static int pass_struct1(int a, int b, struct1 x) {
322 return check_struct1(x);
325 static int pass_struct1(int a, struct1 x) {
328 return check_struct1(x);
331 static int pass_struct1(struct1 x) {
332 return check_struct1(x);
335 public static int test_0_struct1_args () {
341 if ((r = check_struct1(x)) != 0)
343 if ((r = pass_struct1(x)) != 0)
345 if ((r = pass_struct1(3, x)) != 0)
347 if ((r = pass_struct1(3, 4, x)) != 0)
352 // 64-bits, 64-bit aligned
357 static int check_struct2(struct2 x) {
363 static int pass_struct2(int a, int b, int c, struct2 x) {
370 return check_struct2(x);
373 static int pass_struct2(int a, int b, struct2 x) {
378 return check_struct2(x);
381 static int pass_struct2(int a, struct2 x) {
384 return check_struct2(x);
387 static int pass_struct2(struct2 x) {
388 return check_struct2(x);
391 public static int test_0_struct2_args () {
396 if ((r = check_struct2(x)) != 0)
398 if ((r = pass_struct2(x)) != 0)
400 if ((r = pass_struct2(3, x)) != 0)
402 if ((r = pass_struct2(3, 4, x)) != 0)
404 if ((r = pass_struct2(3, 4, 5, x)) != 0)
411 public long i, j, k, l;
414 static int pass_struct3 (int i, int j, int k, int l, int m, int n, int o, int p, Struct3 s, int q) {
415 if (s.i + s.j + s.k + s.l != 10)
421 public static int test_0_struct3_args () {
422 Struct3 s = new Struct3 ();
428 return pass_struct3 (1, 2, 3, 4, 5, 6, 7, 8, s, 9);
431 // Struct with unaligned size on 64 bit machines
433 public int i, j, k, l, m;
434 public int i1, i2, i3, i4, i5, i6;
437 static int pass_struct4 (Struct4 s) {
438 if (s.i + s.j + s.k + s.l + s.m != 15)
444 public static int test_0_struct4_args () {
445 Struct4 s = new Struct4 ();
452 return pass_struct4 (s);
460 public AStruct (int i) {
464 public override int GetHashCode () {
469 // Test that vtypes are unboxed during a virtual call
470 public static int test_44_unbox_trampoline () {
471 AStruct s = new AStruct (44);
473 return o.GetHashCode ();
476 public static int test_0_unbox_trampoline2 () {
480 if (i.ToString () != "12")
482 if (((Int32)o).ToString () != "12")
484 if (o.ToString () != "12")
489 // Test fields with big offsets
490 public static int test_0_fields_with_big_offsets () {
491 StructWithBigOffsets s = new StructWithBigOffsets ();
492 StructWithBigOffsets s2 = new StructWithBigOffsets ();
518 if (s2.i != 0xdeadbeef)
520 if (s2.l != 0xcafebabe)
539 int buf_length, buf_offset;
547 public long Seek (long position) {
549 /* interaction between the register allocator and
550 * allocating arguments to registers */
551 if (pos >= buf_start && pos <= buf_start + buf_length) {
552 buf_offset = (int) (pos - buf_start);
560 public static int test_0_seektest () {
561 TestRegA t = new TestRegA ();
562 return (int)t.Seek (0);
565 class Super : ICloneable {
566 public virtual object Clone () {
573 public static int test_0_null_cast () {
581 public static int test_0_super_cast () {
582 Duper d = new Duper ();
596 d = (Duper)(object)sup;
603 public static int test_0_super_cast_array () {
604 Duper[] d = new Duper [0];
615 if (!(d is Object[]))
618 d = (Duper[])(object[])sup;
625 public static int test_0_multi_array_cast () {
626 Duper[,] d = new Duper [1, 1];
630 o [0, 0] = new Super ();
633 catch (ArrayTypeMismatchException) {
639 public static int test_0_vector_array_cast () {
640 Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
641 Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
642 Array arr5 = Array.CreateInstance (typeof (string), new int[] {1}, new int[] {10});
644 if (arr1.GetType () != typeof (int[]))
647 if (arr2.GetType () == typeof (int[]))
658 catch (InvalidCastException) {
663 var as_object_arr = arr5 as object [];
664 if (as_object_arr != null)
667 int [,] [] arr3 = new int [1, 1] [];
669 int [,] [] arr4 = (int [,] [])o;
674 public static int test_0_enum_array_cast () {
675 TypeCode[] tc = new TypeCode [0];
684 if (a is ValueType[])
698 vta = (ValueType[])a;
715 public static int test_0_more_cast_corner_cases () {
716 ValueType[] vta = new ValueType [0];
717 Enum[] ea = new Enum [0];
722 if (!(a is object[]))
724 if (!(a is ValueType[]))
729 if (!(a is object[]))
731 if (!(a is ValueType[]))
793 public static int test_0_cast_iface_array () {
794 object o = new ICloneable [0];
795 object o2 = new Duper [0];
799 if (!(o is object[]))
801 if (!(o2 is ICloneable[]))
815 t = (ICloneable[])o2;
831 if (!(o is ICloneable[]))
834 /* add tests for interfaces that 'inherit' interfaces */
838 private static int[] daysmonthleap = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
840 private static int AbsoluteDays (int year, int month, int day)
843 int[] days = daysmonthleap;
846 return ((day-1) + temp + (365* (year-1)) + ((year-1)/4) - ((year-1)/100) + ((year-1)/400));
849 public static int test_719162_complex_div () {
850 int adays = AbsoluteDays (1970, 1, 1);
854 delegate int GetIntDel ();
856 static int return4 () {
864 public static int test_2_static_delegate () {
865 GetIntDel del = new GetIntDel (return4);
872 public static int test_2_instance_delegate () {
873 Tests t = new Tests ();
874 GetIntDel del = new GetIntDel (t.return5);
881 class InstanceDelegateTest {
884 public int return_field () {
889 public static int test_2_instance_delegate_with_field () {
890 InstanceDelegateTest t = new InstanceDelegateTest () { a = 1337 };
891 GetIntDel del = new GetIntDel (t.return_field);
898 interface IFaceVirtualDel {
902 struct VtypeVirtualDelStruct : IFaceVirtualDel {
904 public int return_field_nonvirt () {
907 public int return_field () {
912 public static int test_42_vtype_delegate () {
913 var s = new VtypeVirtualDelStruct () { f = 42 };
914 Func<int> f = s.return_field_nonvirt;
918 public static int test_42_vtype_virtual_delegate () {
919 IFaceVirtualDel s = new VtypeVirtualDelStruct () { f = 42 };
920 Func<int> f = s.return_field;
924 public static int test_1_store_decimal () {
925 decimal[,] a = {{1}};
932 public static int test_2_intptr_stobj () {
933 System.IntPtr [] arr = { new System.IntPtr () };
935 if (arr [0] != (System.IntPtr)0)
940 static int llmult (int a, int b, int c, int d) {
941 return a + b + c + d;
945 * Test that evaluation of complex arguments does not overwrite the
946 * arguments already in outgoing registers.
948 public static int test_155_regalloc () {
954 int[] arr = new int [5];
956 return llmult (arr [c + d], 150, 5, 0);
959 static bool large_struct_test (Large a, Large b, Large c, Large d)
961 if (!a.check ()) return false;
962 if (!b.check ()) return false;
963 if (!c.check ()) return false;
964 if (!d.check ()) return false;
968 public static int test_2_large_struct_pass ()
979 if (large_struct_test (a, b, c, d))
984 public static unsafe int test_0_pin_string () {
986 fixed (char *c = x) {
993 public static int my_flags;
994 public static int test_0_and_cmp_static ()
997 /* various forms of test [mem], imm */
999 my_flags = 0x01020304;
1001 if ((my_flags & 0x01020304) == 0)
1004 if ((my_flags & 0x00000304) == 0)
1007 if ((my_flags & 0x00000004) == 0)
1010 if ((my_flags & 0x00000300) == 0)
1013 if ((my_flags & 0x00020000) == 0)
1016 if ((my_flags & 0x01000000) == 0)
1023 public static int test_0_byte_compares ()
1029 if (!(b < System.Byte.MaxValue))
1032 if (!(b <= System.Byte.MaxValue))
1038 static Nullable<bool> s_nullb;
1039 static AStruct s_struct1;
1041 /* test if VES uses correct sizes for value type write to static field */
1042 public static int test_0_static_nullable_bool () {
1043 s_struct1 = new AStruct (0x1337dead);
1045 /* make sure that the write to s_nullb didn't smash the value after it */
1046 if (s_struct1.i != 0x1337dead)
1051 public static int test_71_long_shift_right () {
1052 ulong value = 38654838087;
1054 byte [] buffer = new byte [1];
1055 buffer [x] = ((byte)(value >> x));
1060 public static int test_0_addsub_mem ()
1077 public static int test_0_sh32_mem ()
1079 y = 0x0102130405060708;
1082 if (y != 0x01021304)
1085 y = 0x0102130405060708;
1088 if (y != 0x0506070800000000)
1091 x = 0x0102130405060708;
1094 if (x != 0x0506070800000000)
1101 static uint dum_de_dum = 1;
1102 public static int test_0_long_arg_opt ()
1104 return Foo (0x1234567887654321, dum_de_dum);
1107 static int Foo (ulong x, ulong y)
1109 if (x != 0x1234567887654321)
1118 public static int test_0_long_ret_opt ()
1121 if (x != 0x1234567887654321)
1132 return 0x1234567887654321;
1140 /* from bug# 71515 */
1141 static int counter = 0;
1142 static bool WriteStuff () {
1146 public static int test_0_cond_branch_side_effects () {
1156 public static int arg_only_written (string file_name, int[]
1158 if (file_name == null)
1167 public static int[] foo () {
1171 public static void bar (int i) {
1175 public static int test_0_arg_only_written ()
1177 return arg_only_written ("md.in", null);
1180 static long position = 0;
1182 public static int test_4_static_inc_long () {
1190 return (int)position;
1195 public FooStruct (long l) {
1199 public static int test_0_calls_opcode_emulation () {
1200 // Test that emulated opcodes do not clobber arguments already in
1204 new FooStruct (val * 10000);
1209 public static int test_0_intrins_string_length () {
1212 return (s.Length == 3) ? 0 : 1;
1215 public static int test_0_intrins_string_chars () {
1218 return (s [0] == 'A' && s [1] == 'B' && s [2] == 'C') ? 0 : 1;
1221 public static int test_0_intrins_object_gettype () {
1224 return (o.GetType () == typeof (int)) ? 0 : 1;
1227 public static int test_0_intrins_object_gethashcode () {
1228 object o = new Object ();
1230 return (o.GetHashCode () == o.GetHashCode ()) ? 0 : 1;
1236 public static int test_0_intrins_object_ctor () {
1237 object o = new FooClass ();
1239 return (o != null) ? 0 : 1;
1242 public static int test_0_intrins_array_rank () {
1243 int[,] a = new int [10, 10];
1245 return (a.Rank == 2) ? 0 : 1;
1248 public static int test_0_intrins_array_length () {
1249 int[,] a = new int [10, 10];
1252 return (a2.Length == 100) ? 0 : 1;
1255 public static int test_0_intrins_runtimehelpers_offset_to_string_data () {
1256 int i = RuntimeHelpers.OffsetToStringData;
1261 public static int test_0_intrins_string_setchar () {
1262 StringBuilder sb = new StringBuilder ("ABC");
1266 return sb.ToString () == "ADC" ? 0 : 1;
1270 bool allowLocation = true;
1274 public static int test_0_regress_78990_unaligned_structs () {
1280 public static unsafe int test_97_negative_index () {
1281 char[] arr = new char[] {'a', 'b'};
1282 fixed (char *p = arr) {
1290 public static int test_0_unsigned_right_shift_imm0 () {
1292 byte[] data = new byte[256];
1293 for (int i = 0; i < 1; i ++)
1294 temp = (uint)(data[temp >> 24] | data[temp >> 0]);
1299 public virtual int foo () {
1304 sealed class Bar2 : Foo2 {
1305 public override int foo () {
1310 public static int test_0_abcrem_check_this_removal () {
1311 Bar2 b = new Bar2 ();
1313 // The check_this generated here by the JIT should be removed
1319 static int invoke_twice (Bar2 b) {
1321 // The check_this generated here by the JIT should be removed
1327 public static int test_0_abcrem_check_this_removal2 () {
1328 Bar2 b = new Bar2 ();
1336 public static int test_0_array_access_64_bit () {
1337 int[] arr2 = new int [10];
1338 for (int i = 0; i < 10; ++i)
1340 string s = "ABCDEFGH";
1342 byte[] arr = new byte [4];
1348 int len = arr [0] | (arr [1] << 8) | (arr [2] << 16) | (arr [3] << 24);
1349 int len2 = - (len + 2);
1351 // Test array and string access with a 32 bit value whose upper 32 bits are
1354 if (arr2 [len2] != 2)
1356 if (s [len2] != 'C')
1361 public static float return_float () {
1365 public static int test_0_float_return_spill () {
1366 // The return value of return_float () is spilled because of the
1368 object o = return_float ();
1369 float f = return_float ();
1370 return (float)o == f ? 0 : 1;
1374 public static float pi = 3.14f;
1376 public float float_field;
1379 public static int test_0_ldsfld_soft_float () {
1380 if (R4Holder.pi == 3.14f)
1386 public static int test_0_ldfld_stfld_soft_float () {
1387 R4Holder h = new R4Holder ();
1388 h.float_field = 3.14f;
1390 if (h.float_field == 3.14f)
1396 class R4HolderRemote : MarshalByRefObject {
1397 public static float pi = 3.14f;
1399 public float float_field;
1402 public static int test_0_ldfld_stfld_soft_float_remote () {
1403 R4HolderRemote h = new R4HolderRemote ();
1404 h.float_field = 3.14f;
1406 if (h.float_field == 3.14f)
1412 public static int test_0_locals_soft_float () {
1428 static float pass_vtype_return_float (AStruct2 s) {
1429 return s.i + s.j == 6 ? 1.0f : -1.0f;
1432 public static int test_0_vtype_arg_soft_float () {
1433 return pass_vtype_return_float (new AStruct2 () { i = 2, j = 4 }) > 0.0 ? 0 : 1;
1436 static int range_check_strlen (int i, string s) {
1437 if (i < 0 || i > s.Length)
1443 public static int test_0_range_check_opt () {
1444 if (range_check_strlen (0, "A") != 0)
1446 if (range_check_strlen (1, "A") != 0)
1448 if (range_check_strlen (2, "A") != 1)
1450 if (range_check_strlen (-100, "A") != 1)
1455 static int test_0_array_get_set_soft_float () {
1456 float[,] arr = new float [2, 2];
1458 return arr [0, 0] == 256f ? 0 : 1;
1462 struct Bug506915 { public int val; }
1463 static int test_2_ldobj_stobj_optization ()
1466 var a = new Bug506915 ();
1467 var b = new Bug506915 ();
1468 if (i.GetHashCode () == 99)
1470 var array = new Bug506915 [2];
1472 array [1] = (i == 0) ? a : array [0];
1474 return array [1].val;
1477 /* mcs can't compile this (#646744) */
1479 static void InitMe (out Gamma noMercyWithTheStack) {
1480 noMercyWithTheStack = new Gamma ();
1483 static int FunNoInline () {
1485 if (x > 344 && x < 22)
1490 static float DoNothingButDontInline (float a, int b) {
1493 else if (b < 0 && b > 10)
1499 * The local register allocator emits loadr8_membase and storer8_membase
1500 * to do spilling. This code is generated after mono_arch_lowering_pass so
1501 * mono_arch_output_basic_block must know how to deal with big offsets.
1502 * This only happens because the call in middle forces the temp for "(float)obj"
1505 public static int test_0_float_load_and_store_with_big_offset ()
1508 Gamma noMercyWithTheStack;
1511 InitMe (out noMercyWithTheStack);
1513 res = DoNothingButDontInline ((float)obj, FunNoInline ());
1525 static int vtype_phi (VTypePhi v1, VTypePhi v2, bool first) {
1526 VTypePhi v = first ? v1 : v2;
1531 static int test_0_vtype_phi ()
1533 VTypePhi v1 = new VTypePhi () { i = 1 };
1534 VTypePhi v2 = new VTypePhi () { i = 2 };
1536 if (vtype_phi (v1, v2, true) != 1)
1538 if (vtype_phi (v1, v2, false) != 2)
1544 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1545 static void UseValue (int index)
1549 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1550 static bool IsFalse ()
1555 static int test_0_llvm_moving_faulting_loads ()
1557 int[] indexes = null;
1560 indexes = new int[0];
1563 while (IsFalse ()) {
1564 UseValue (indexes[0]);
1565 UseValue (indexes[0]);
1571 public static bool flag;
1575 internal static B[] d;
1582 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1583 static int regress_679467_inner () {
1592 * FIXME: This fails with AOT #703317.
1595 static int test_0_multiple_cctor_calls_regress_679467 () {
1597 return regress_679467_inner ();
1601 static int test_0_char_ctor () {
1602 string s = new String (new char[] { 'A', 'B' }, 0, 1);
1606 static object mInstance = null;
1608 [MethodImpl(MethodImplOptions.Synchronized)]
1609 public static object getInstance() {
1610 if (mInstance == null)
1611 mInstance = new object();
1615 static int test_0_synchronized () {
1625 public static BStruct foo () {
1626 return new BStruct () { t = typeof (T) };
1630 delegate BStruct ADelegate ();
1632 static int test_0_regress_10601 () {
1633 var act = (ADelegate)(Del<string>.foo);
1635 if (b.t != typeof (string))
1640 static int test_0_regress_11058 () {
1641 int foo = -252674008;
1642 int foo2 = (int)(foo ^ 0xF0F0F0F0); // = 28888
1643 var arr = new byte[foo2].Length;
1647 public static void do_throw () {
1648 throw new Exception ();
1651 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1652 static void empty () {
1656 public static int test_0_llvm_inline_throw () {
1659 } catch (Exception) {
1666 enum ByteEnum : byte {
1680 public static int test_0_14217 () {
1681 t_14217_inner (new BugStruct ());
1685 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1686 static void t_14217_inner (BugStruct bug) {
1689 [StructLayout(LayoutKind.Sequential)]
1690 public struct EmptyStruct {
1694 public static EmptyStruct s;
1698 static int test_0_empty_struct_as_static () {
1699 var s = EmptyClass.s;
1704 static int test_0_int_to_r4 () {
1705 return int_to_r4_inner (255);
1708 static int int_to_r4_inner (int value1) {
1710 float mult = sub * 1f;
1711 if (mult != -255.0f)
1718 public double a, b, c, d;
1721 static double arm64_hfa_on_stack_inner (double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, HFA4D s) {
1722 return s.a + s.b + s.c + s.d;
1725 static int test_0_arm64_hfa_on_stack () {
1726 var s = new HFA4D () { a = 1.0, b = 2.0, c = 3.0, d = 4.0 };
1727 var res = arm64_hfa_on_stack_inner (1, 2, 3, 4, 5, 6, 7, 8, s);
1728 return res == 10.0 ? 0 : 1;
1732 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1733 public unsafe void EncodeIntoBuffer(char* value, int valueLength, char* buffer, int bufferLength) {
1737 static unsafe int test_0_mul_ovf_regress_36052 () {
1738 var p = new MulOvfClass ();
1740 string typeName = typeof(int).Name;
1741 int bufferSize = 45;
1743 fixed (char* value = typeName) {
1744 char* buffer = stackalloc char[bufferSize];
1745 p.EncodeIntoBuffer(value, typeName.Length, buffer, bufferSize);
1751 public int a, b, c, d;
1754 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1755 static int pass_struct16 (object o0, object o2, object o3, object o4, object o5, object o6, object o7, Struct16 o8) {
1756 // This disables LLVM
1763 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1764 static int pass_struct16 (object o0, object o2, object o3, object o6, object o7, Struct16 o8) {
1765 return pass_struct16 (o0, o2, null, o3, null, o6, o7, o8);
1768 public static int test_42_pass_16byte_struct_split () {
1769 return pass_struct16 (null, null, null, null, null, new Struct16 () { a = 42 });
1772 public interface IComparer2
1777 public class AClass : IComparer2 {
1778 public Type foo<T> () {
1783 public static int test_0_delegate_to_virtual_generic_on_ifaces () {
1784 IComparer2 c = new AClass ();
1786 Func<Type> f = c.foo<string>;
1787 return f () == typeof(string) ? 0 : 1;
1790 public enum ByteEnum2 : byte {
1794 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1795 public static int enum_arg_zero_extend (ByteEnum2 b) {
1799 public static int test_142_byte_enum_arg_zero_extend () {
1800 return enum_arg_zero_extend (ByteEnum2.High);
1803 enum Mine { One, Two }
1805 public static int test_0_enum_gethashcode_opt () {
1807 for (int i = 0; i < 1000000; ++i)
1808 sum += Mine.Two.GetHashCode();
1813 public static int test_0_typedref () {
1815 System.TypedReference r = __makeref(i);
1816 System.Type t = __reftype(r);
1818 if (t != typeof (int))
1820 int j = __refvalue(r, int);
1825 object o = __refvalue (r, object);
1826 } catch (InvalidCastException) {