From 707231e1b422e48d937523017236935c9eb7db83 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Tue, 26 Sep 2017 14:57:45 -0700 Subject: [PATCH] [mini] Adjust some test suites to work under mobile. --- mono/mini/builtin-types.cs | 2 ++ mono/mini/devirtualization.cs | 4 +++- mono/mini/gc-test.cs | 30 +++++++++++++++++++----------- mono/mini/test.cs | 6 ++++++ 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/mono/mini/builtin-types.cs b/mono/mini/builtin-types.cs index ff4f689290d..de06a0dc579 100644 --- a/mono/mini/builtin-types.cs +++ b/mono/mini/builtin-types.cs @@ -792,9 +792,11 @@ public class BuiltinTests { return 0; } +#if !__MOBILE__ public static int Main (String[] args) { return TestDriver.RunTests (typeof (BuiltinTests), args); } +#endif } diff --git a/mono/mini/devirtualization.cs b/mono/mini/devirtualization.cs index bf1134be6bb..14b3f9b1571 100644 --- a/mono/mini/devirtualization.cs +++ b/mono/mini/devirtualization.cs @@ -86,11 +86,13 @@ sealed public class SealedFinal : Middle { } -class Tests { +class DevirtualizationTests { +#if !__MOBILE__ static int Main (string[] args) { return TestDriver.RunTests (typeof (Tests), args); } +#endif static public int test_0_sealed_class_devirt_right_method () { SealedFinal x = new SealedFinal (); diff --git a/mono/mini/gc-test.cs b/mono/mini/gc-test.cs index 023a56d7165..91234b6eec8 100644 --- a/mono/mini/gc-test.cs +++ b/mono/mini/gc-test.cs @@ -7,12 +7,17 @@ using System.Threading; /* * Regression tests for the GC support in the JIT */ - -class Tests { - - static int Main () { - return TestDriver.RunTests (typeof (Tests)); - } +#if __MOBILE__ +class GcTests +#else +class Tests +#endif +{ +#if !__MOBILE__ + public static int Main (string[] args) { + return TestDriver.RunTests (typeof (Tests), args); + } +#endif public static int test_36_simple () { // Overflow the registers @@ -525,9 +530,16 @@ class Tests { return 0; } + class ObjWithShiftOp { + public static ObjWithShiftOp operator >> (ObjWithShiftOp bi1, int shiftVal) { + clobber_regs_and_gc (); + return bi1; + } + } + // Liveness for spill slots holding managed pointers public static int test_0_liveness_11 () { - Tests[] arr = new Tests [10]; + ObjWithShiftOp[] arr = new ObjWithShiftOp [10]; // This uses an ldelema internally // FIXME: This doesn't crash if mp-s are not correctly tracked, just writes to // an old object. @@ -536,10 +548,6 @@ class Tests { return 0; } - public static Tests operator >> (Tests bi1, int shiftVal) { - clobber_regs_and_gc (); - return bi1; - } [MethodImplAttribute (MethodImplOptions.NoInlining)] public static void liveness_12_inner (int a, int b, int c, int d, int e, int f, object o, ref string s) { diff --git a/mono/mini/test.cs b/mono/mini/test.cs index 49e17ad14dd..956a6310169 100644 --- a/mono/mini/test.cs +++ b/mono/mini/test.cs @@ -338,11 +338,17 @@ namespace SSA { return a; } +#if __MOBILE__ + public static test_2_old_test_suite () { + return test1 (1); + } +#else static int Main() { if (test1 (1) != 2) return 1; return 0; } +#endif } } -- 2.25.1