Skip to content

Commit 18a0403

Browse files
authored
Convert JIT\Directed tests to merged test groups (#83256)
Steps involved in conversion: - Remove test straccess4 - identical to straccess3_cs_d - Remove duplicate csproj files - identical to versions without _cs in their names - Manually remove main arg from out_of_range_fp_to_int_conversions. - Remove Main from straccess3 (save as comment for local use) - Remove switchdefaultonly* Main argument (replace with noinline constant argument) - Remove IL namespace/class declarations (in shift/) that break ILTransform tool Related PR #64837 - Use $(TestLibraryProjectPath) in 5 ilproj files (helps ILTransform) Related PR #66157 - Manually rename ldfldstatic1_il_r Actual dedup strategy groups projs in groups based on suffixes _r, _d, etc. This file does not have a matching _d version, which leads ILTransform to inconsistently renaming projects. - [cs-main] Remove unused Main arg from arglist\vararg.cs - [ILTransform -p] Rename _d/_r ilproj to _il_d/_il_r (but undo debuginfo/tests) - [ILTransform -n] 3 iterations - Deduplicate project names - [ILTransform -a] Match .assembly names to project names - [ILTransform -prociso] Set RequiresProcessIsolation based on other attributes - [ILTransform -collapse-main-sig] Collapse .method Main to one line to help future ILTransform passes - [ILTransform -public] Make entry points public, add class if entrypoint is global - Manually remove "public public" from C# (ILTransform failure on multiline declaration) - Manually fix accessibility after exposing main class (other now-public methods with private signatures) - Manually add missing public/class to entry points (missed by ILTransform) - [ILTransform -sr] Fix System.Runtime references - [ILTransform -ilfact] [Fact], Main->TestEntryPoint, no OutputType==Exe - Add projects for merged test runners and Directory.Build.props - Move simple test runner code to __GenerateMainWrapper.Main (avoids conflicts with Program in tests) - Rename IL classes to avoid keywords - Manually update issues.targets (after renaming various projects) - Manually convert more_tails.cs (and generated IL from it) - Manually fix punning.cs (depended on simple wrapper using "class Program") - Finish merge - incorporate changes to csproj/Dir.B.props - fix xunit.analyzers errors - Rename csproj to be shorter/more consistent with upcoming JIT/Regression change
1 parent 2fc33b3 commit 18a0403

File tree

1,051 files changed

+3115
-3043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,051 files changed

+3115
-3043
lines changed

src/tests/JIT/Directed/Arrays/Complex1.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
43
<CLRTestPriority>1</CLRTestPriority>
54
</PropertyGroup>
65
<PropertyGroup>

src/tests/JIT/Directed/Arrays/Complex2.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
43
<CLRTestPriority>1</CLRTestPriority>
54
</PropertyGroup>
65
<PropertyGroup>

src/tests/JIT/Directed/Arrays/LoopCloning.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
using System;
66
using System.Runtime.CompilerServices;
77
using System.Runtime.Intrinsics;
8+
using Xunit;
89

910
public class Program
1011
{
11-
public static unsafe int Main()
12+
[Fact]
13+
public static unsafe int TestEntryPoint()
1214
{
1315
int result = 0;
1416
try {

src/tests/JIT/Directed/Arrays/LoopCloning.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
43
<CLRTestPriority>1</CLRTestPriority>
54
</PropertyGroup>
65
<PropertyGroup>

src/tests/JIT/Directed/Arrays/Simple1.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
43
<CLRTestPriority>1</CLRTestPriority>
54
</PropertyGroup>
65
<PropertyGroup>

src/tests/JIT/Directed/Arrays/Simple2.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
43
<CLRTestPriority>1</CLRTestPriority>
54
</PropertyGroup>
65
<PropertyGroup>

src/tests/JIT/Directed/Arrays/complex1.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
using System;
6+
using Xunit;
67

78
// Do a complex 5 dimensional Jagged array.
89
struct Complex
@@ -13,10 +14,11 @@ public void mul_em()
1314
c = a * b;
1415
}
1516
};
16-
public
17-
class Complex_Array_Test
17+
18+
public class Complex_Array_Test
1819
{
19-
public static int Main()
20+
[Fact]
21+
public static int TestEntryPoint()
2022
{
2123
Console.WriteLine("Starting...");
2224
int SIZE = 10;

src/tests/JIT/Directed/Arrays/complex2.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
using System;
6+
using Xunit;
67
public struct Yak
78
{
89
public Int32 a;
@@ -16,13 +17,14 @@ public void Do_Something()
1617
}
1718

1819

19-
internal class Complex2_Array_Test
20+
public class Complex2_Array_Test
2021
{
21-
public static void test(Yak[,,,,,,] Odd_Variable)
22+
internal static void test(Yak[,,,,,,] Odd_Variable)
2223
{
2324
Console.Write(Odd_Variable.Length);
2425
}
25-
public static int Main()
26+
[Fact]
27+
public static int TestEntryPoint()
2628
{
2729
Console.WriteLine("Starting...");
2830
int SIZE = 2;

src/tests/JIT/Directed/Arrays/nintindexoutofrange.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
//
44
using System;
55
using System.Runtime.CompilerServices;
6+
using Xunit;
67

7-
class NintIndexOutOfRangeTest
8+
public class NintIndexOutOfRangeTest
89
{
910
[MethodImpl(MethodImplOptions.NoInlining)]
1011
static void Stelem_Ref(object[] arr, nint i, Object value)
@@ -20,7 +21,8 @@ static void LdElemA(object[] arr, nint i)
2021
LdElemATestHelper(ref arr[i]);
2122
}
2223

23-
public static unsafe int Main()
24+
[Fact]
25+
public static unsafe int TestEntryPoint()
2426
{
2527
long longIndex = ((long)1) << 32;
2628
nint index = (nint)longIndex;

src/tests/JIT/Directed/Arrays/nintindexoutofrange.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
43
<CLRTestPriority>0</CLRTestPriority>
54
</PropertyGroup>
65
<PropertyGroup>

0 commit comments

Comments
 (0)