From: Andy Ayers Date: Wed, 20 Feb 2019 20:39:02 +0000 (-0800) Subject: Fix dblarray tests and reenable for arm32 (#22718) X-Git-Tag: accepted/tizen/unified/20190813.215958~61^2~192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33f693194fb6c0fb907e513eab9936397498a9e5;p=platform%2Fupstream%2Fcoreclr.git Fix dblarray tests and reenable for arm32 (#22718) Run the allocate/gen-check sequence under a forbid GC region, and enable the tests for arm32. Closes #22015. --- diff --git a/tests/issues.targets b/tests/issues.targets index bfaf3f2..c485c63 100644 --- a/tests/issues.targets +++ b/tests/issues.targets @@ -568,18 +568,6 @@ 17129 - - 22015 - - - 22015 - - - 22015 - - - 22015 - diff --git a/tests/src/JIT/Methodical/doublearray/dblarray1.cs b/tests/src/JIT/Methodical/doublearray/dblarray1.cs index d955e4b..de3a234 100644 --- a/tests/src/JIT/Methodical/doublearray/dblarray1.cs +++ b/tests/src/JIT/Methodical/doublearray/dblarray1.cs @@ -77,20 +77,34 @@ internal class DblArray1 } } + public static void Run(Action f) + { + try + { + GC.TryStartNoGCRegion(500_000); + f(); + } + finally + { + GC.EndNoGCRegion(); + } + } + public static int Main() { if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86") { s_LOH_GEN = 2; } + try { - f0(); - f1(); - f2(); - f3(); - f4(); - f5(); + Run(f0); + Run(f1); + Run(f2); + Run(f3); + Run(f4); + Run(f5); } catch (Exception e) { diff --git a/tests/src/JIT/Methodical/doublearray/dblarray2.cs b/tests/src/JIT/Methodical/doublearray/dblarray2.cs index 16281a6..f05fb59 100644 --- a/tests/src/JIT/Methodical/doublearray/dblarray2.cs +++ b/tests/src/JIT/Methodical/doublearray/dblarray2.cs @@ -266,39 +266,53 @@ internal class DblArray } } + public static void Run(Action f) + { + try + { + GC.TryStartNoGCRegion(500_000); + f(); + } + finally + { + GC.EndNoGCRegion(); + } + } + public static int Main() { if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86") { s_LOH_GEN = 2; } + try { - f0(); - f1a(); - f2a(); - f3a(); - f4a(); - f5a(); - f6a(); - f7a(); - f8a(); - f9a(); - f10a(); - f11a(); - f12a(); - f1b(); - f2b(); - f3b(); - f4b(); - f5b(); - f6b(); - f7b(); - f8b(); - f9b(); - f10b(); - f11b(); - f12b(); + Run(f0); + Run(f1a); + Run(f2a); + Run(f3a); + Run(f4a); + Run(f5a); + Run(f6a); + Run(f7a); + Run(f8a); + Run(f9a); + Run(f10a); + Run(f11a); + Run(f12a); + Run(f1b); + Run(f2b); + Run(f3b); + Run(f4b); + Run(f5b); + Run(f6b); + Run(f7b); + Run(f8b); + Run(f9b); + Run(f10b); + Run(f11b); + Run(f12b); } catch (Exception e) { diff --git a/tests/src/JIT/Methodical/doublearray/dblarray3.cs b/tests/src/JIT/Methodical/doublearray/dblarray3.cs index 5feb6f6..f9167bc 100644 --- a/tests/src/JIT/Methodical/doublearray/dblarray3.cs +++ b/tests/src/JIT/Methodical/doublearray/dblarray3.cs @@ -126,6 +126,19 @@ internal class DblArray3 } } + public static void Run(Action f) + { + try + { + GC.TryStartNoGCRegion(500_000); + f(); + } + finally + { + GC.EndNoGCRegion(); + } + } + public static int Main() { Console.WriteLine(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")); @@ -133,18 +146,19 @@ internal class DblArray3 { s_LOH_GEN = 2; } + try { - f0(); - f1a(); - f1b(); - f1c(); - f1d(); - f2a(); - f2b(); - f3(); - f4(); - f5(); + Run(f0); + Run(f1a); + Run(f1b); + Run(f1c); + Run(f1d); + Run(f2a); + Run(f2b); + Run(f3); + Run(f4); + Run(f5); } catch (Exception e) { diff --git a/tests/src/JIT/Methodical/doublearray/dblarray4.cs b/tests/src/JIT/Methodical/doublearray/dblarray4.cs index dc212f6..c31a3e4 100644 --- a/tests/src/JIT/Methodical/doublearray/dblarray4.cs +++ b/tests/src/JIT/Methodical/doublearray/dblarray4.cs @@ -27,14 +27,23 @@ internal class DblArray4 Console.WriteLine("DoubleArrayToLargeObjectHeap is {0}", Environment.GetEnvironmentVariable("complus_DoubleArrayToLargeObjectHeap")); - double[] arr = new double[101]; - if (GC.GetGeneration(arr) != s_LOH_GEN) + try { - Console.WriteLine("Generation {0}", GC.GetGeneration(arr)); - Console.WriteLine("FAILED"); - return 1; + GC.TryStartNoGCRegion(500_000); + double[] arr = new double[101]; + if (GC.GetGeneration(arr) != s_LOH_GEN) + { + Console.WriteLine("Generation {0}", GC.GetGeneration(arr)); + Console.WriteLine("FAILED"); + return 1; + } + + Console.WriteLine("PASSED"); + return 100; + } + finally + { + GC.EndNoGCRegion(); } - Console.WriteLine("PASSED"); - return 100; } }