2 using System.Reflection;
5 * Regression tests for the mono JIT.
7 * Each test needs to be of the form:
9 * static int test_<result>_<name> ();
11 * where <result> is an integer (the value that needs to be returned by
12 * the method to make it pass.
13 * <name> is a user-displayed name used to identify the test.
15 * The tests can be driven in two ways:
16 * *) running the program directly: Main() uses reflection to find and invoke
17 * the test methods (this is useful mostly to check that the tests are correct)
18 * *) with the --regression switch of the jit (this is the preferred way since
19 * all the tests will be run with optimizations on and off)
21 * The reflection logic could be moved to a .dll since we need at least another
22 * regression test file written in IL code to have better control on how
29 return TestDriver.RunTests (typeof (Tests));
32 public static int test_36_simple () {
33 // Overflow the registers
43 /* Prevent the variables from being local to a bb */
48 return (int)o1 + (int)o2 + (int)o3 + (int)o4 + (int)o5 + (int)o6 + (int)o7 + (int)o8;
53 public static int test_36_liveness () {
55 object o1, o2, o3, o4, o5, o6, o7, o8;
71 return (int)o1 + (int)o2 + (int)o3 + (int)o4 + (int)o5 + (int)o6 + (int)o7 + (int)o8;
81 public FooStruct (int i1, int i, int i2) {
88 public static int test_4_vtype () {
89 FooStruct s = new FooStruct (1, 2, 3);
93 return (int)s.o1 + (int)s.o2;
97 public object o1, o2, o3, o4, o5, o6, o7, o8, o9, o10;
98 public object o11, o12, o13, o14, o15, o16, o17, o18, o19, o20;
99 public object o21, o22, o23, o24, o25, o26, o27, o28, o29, o30;
100 public object o31, o32;
103 static void set_fields (BigClass b) {
139 // Test marking of objects with > 32 fields
140 public static int test_528_mark_runlength_large () {
141 BigClass b = new BigClass ();
144 * Do the initialization in a separate method so no object refs remain in
152 (int)b.o1 + (int)b.o2 + (int)b.o3 + (int)b.o4 + (int)b.o5 +
153 (int)b.o6 + (int)b.o7 + (int)b.o8 + (int)b.o9 + (int)b.o10 +
154 (int)b.o11 + (int)b.o12 + (int)b.o13 + (int)b.o14 + (int)b.o15 +
155 (int)b.o16 + (int)b.o17 + (int)b.o18 + (int)b.o19 + (int)b.o20 +
156 (int)b.o21 + (int)b.o22 + (int)b.o23 + (int)b.o24 + (int)b.o25 +
157 (int)b.o26 + (int)b.o27 + (int)b.o28 + (int)b.o29 + (int)b.o30 +
158 (int)b.o31 + (int)b.o32;