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 static int test_0_beq () {
39 static int test_0_bne_un () {
46 static int test_0_conv_r8 () {
53 static int test_0_conv_i4 () {
61 static int test_5_add () {
67 static int test_5_sub () {
73 static int test_24_mul () {
79 static int test_4_div () {
85 static int test_2_rem () {
91 static int test_2_neg () {
96 static int test_46_float_spill () {
97 // we overflow the FP stack
108 return (int)(1.0 + (a + (b + (c + (d + (e + (f + (g + (h + i)))))))));
111 static int test_4_long_cast () {
113 double d = (double)a;
120 static unsafe int test_2_negative_zero () {
125 byte *ptr = (byte*)&d;
138 static int test_15_float_cmp () {
222 static int test_15_float_cmp_un () {
223 double a = Double.NaN;
306 static int test_15_float_branch () {
374 static int test_15_float_branch_un () {
375 double a = Double.NaN;