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 void dummy () {
35 static int test_0_return () {
40 static int dummy1 () {
44 static int test_2_int_return () {
51 static int add1 (int val) {
55 static int test_1_int_pass () {
62 static int add_many (int val, short t, byte b, int da) {
63 return val + t + b + da;
66 static int test_1_int_pass_many () {
68 int r = add_many (5, 2, b, 1);
74 unsafe static float GetFloat (byte *ptr) {
78 unsafe public static float GetFloat(float value)
80 return GetFloat((byte *)&value);
84 static int test_2_inline_saved_arg_type () {
86 return GetFloat (f) == f? 2: 1;