summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2019-02-20 12:39:02 -0800
committerGitHub <noreply@github.com>2019-02-20 12:39:02 -0800
commit33f693194fb6c0fb907e513eab9936397498a9e5 (patch)
tree003c717c4af97ef40afd986f96b5ad0fc39f3557 /tests
parent57b0be625346712fd3bafb71a9568edb579971f1 (diff)
downloadcoreclr-33f693194fb6c0fb907e513eab9936397498a9e5.tar.gz
coreclr-33f693194fb6c0fb907e513eab9936397498a9e5.tar.bz2
coreclr-33f693194fb6c0fb907e513eab9936397498a9e5.zip
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/issues.targets12
-rw-r--r--tests/src/JIT/Methodical/doublearray/dblarray1.cs26
-rw-r--r--tests/src/JIT/Methodical/doublearray/dblarray2.cs64
-rw-r--r--tests/src/JIT/Methodical/doublearray/dblarray3.cs34
-rw-r--r--tests/src/JIT/Methodical/doublearray/dblarray4.cs23
5 files changed, 99 insertions, 60 deletions
diff --git a/tests/issues.targets b/tests/issues.targets
index bfaf3f20e6..c485c6328a 100644
--- a/tests/issues.targets
+++ b/tests/issues.targets
@@ -568,18 +568,6 @@
<ExcludeList Include="$(XunitTestBinBase)/GC/Scenarios/Dynamo/dynamo/*">
<Issue>17129</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/doublearray/dblarray3_cs_do/*">
- <Issue>22015</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/doublearray/dblarray3_cs_d/*">
- <Issue>22015</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/doublearray/dblarray3_cs_ro/*">
- <Issue>22015</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/doublearray/dblarray3_cs_r/*">
- <Issue>22015</Issue>
- </ExcludeList>
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/doublearray/dblarray1.cs b/tests/src/JIT/Methodical/doublearray/dblarray1.cs
index d955e4bc27..de3a234683 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 16281a6dee..f05fb59937 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 5feb6f6e78..f9167bc3b3 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 dc212f6183..c31a3e449e 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;
}
}