Skip to content

Commit

Permalink
Convert JIT/SIMD to a merged test group (#85852)
Browse files Browse the repository at this point in the history
See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool.

* [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties
* [ILTransform -public] Make test entrypoints accessible
* Manual fixes for [ILTransform -public] - public partial classes
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* Remove DOTNET_JitFuncInfoLogFile/SIMD.log from JIT/SIMD
* Manual fixes for xUnit1013 - internal methods
* Manually fix case of accessibility of test in nested type
* Add merged group
  • Loading branch information
markples authored May 12, 2023
1 parent 2c31cd7 commit 6e49147
Show file tree
Hide file tree
Showing 177 changed files with 258 additions and 445 deletions.
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/AbsGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
const float EPS = Single.Epsilon * 5;

Expand All @@ -20,7 +21,8 @@ static short[] GenerateArray(int size, short value)
return arr;
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
short[] arr = GenerateArray(60, 5);
var a = new System.Numerics.Vector<short>(arr);
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/AbsGeneric_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/AbsGeneric_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/AbsSqrt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
using System.Collections.Generic;
using System.Numerics;
using Point = System.Numerics.Vector4;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
static int Main()
[Fact]
public static int TestEntryPoint()
{
Point a = new Point(11, 13, 8, 4);
Point b = new Point(11, 13, 2, 1);
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/AbsSqrt_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/AbsSqrt_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/AddingSequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using System;
using System.Collections.Generic;
using Point = System.Numerics.Vector2;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
const float EPS = Single.Epsilon * 5;

Expand Down Expand Up @@ -41,7 +42,8 @@ static int Adds()
return 100;
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
Point a = new Point(0, 0), b = new Point(1, 0);
Point c = a + b;
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/AddingSequence_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/AddingSequence_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/BitwiseOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using System;
using System.Collections.Generic;
using Point = System.Numerics.Vector2;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
public const int DefaultSeed = 20010415;
public static int Seed = Environment.GetEnvironmentVariable("CORECLR_SEED") switch
Expand Down Expand Up @@ -108,7 +109,8 @@ static int TestBool()
return 100;
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
if (TestDouble() != 100)
{
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/BitwiseOperations_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/BitwiseOperations_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/BoxUnbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
static int Main()
[Fact]
public static int TestEntryPoint()
{
{
var a = new System.Numerics.Vector<int>(1);
Expand Down
1 change: 0 additions & 1 deletion src/tests/JIT/SIMD/BoxUnbox_r.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/BoxUnbox_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/BugWithAVX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Numerics;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
static int Main()
[Fact]
public static int TestEntryPoint()
{
int Count = System.Numerics.Vector<int>.Count;
return 100;
Expand Down
1 change: 0 additions & 1 deletion src/tests/JIT/SIMD/BugWithAVX_r.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/tests/JIT/SIMD/BugWithAVX_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/CircleInConvex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Numerics;

using Point = System.Numerics.Vector2;
using Xunit;


namespace ClassLibrary
Expand Down Expand Up @@ -51,7 +52,7 @@ static public float max(float a, float b)
return a > b ? a : b;
}

static public void swap(ref float a, ref float b)
static internal void swap(ref float a, ref float b)
{
float c = a;
a = b;
Expand Down Expand Up @@ -242,7 +243,8 @@ static float NextFloat(Random random)
return (float)(mantissa * exponent);
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
List<Point> points = new List<Point>();
Random random = new Random(13);
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/CircleInConvex_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/CircleInConvex_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/CreateGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
const float EPS = Single.Epsilon * 5;

static int Main()
[Fact]
public static int TestEntryPoint()
{
var a = new System.Numerics.Vector<short>(51);
for (int i = 0; i < System.Numerics.Vector<short>.Count; ++i)
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/CreateGeneric_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/CreateGeneric_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/SIMD/CtorFromArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using System;
using System.Collections.Generic;
using Point = System.Numerics.Vector<int>;
using Xunit;

namespace VectorMathTests
{
class Program
public class Program
{
static int[] GenerateArray(int size, int value)
{
Expand All @@ -18,7 +19,8 @@ static int[] GenerateArray(int size, int value)
return arr;
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
int v = 2;
int[] arr = GenerateArray(20, v);
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/CtorFromArray_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/CtorFromArray_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
8 changes: 5 additions & 3 deletions src/tests/JIT/SIMD/Ctors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using Xunit;

internal partial class VectorTest
public partial class VectorTest
{
private const int Pass = 100;
private const int Fail = -1;

class Program
public class Program
{
const float EPS = Single.Epsilon * 5;

Expand Down Expand Up @@ -70,7 +71,8 @@ static int Vector4Ctors()
return 100;
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
int returnVal = Pass;

Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/Ctors_r.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/SIMD/Ctors_ro.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
Expand Down
Loading

0 comments on commit 6e49147

Please sign in to comment.