Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unique IL assembly names instead of automatic renaming #85185

Merged
merged 13 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
27 changes: 0 additions & 27 deletions src/tests/Directory.Merged.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,5 @@
<PropertyGroup>
<InMergedTestDirectory>true</InMergedTestDirectory>
<BuildAsStandalone Condition="'$(BuildAsStandalone)' == ''">false</BuildAsStandalone>

<!--
We need to rewrite the assembly name for some tests in merged groups:
1. Merged test groups require consistency between the various names of tests in order
to reference them properly.
2. IL tests specify the assembly name explicitly in the source file via
".assembly" lines.
3. Several tests can use the same IL file but build it with different command line
options (_il_d vs _il_r).

Note that C# tests (which may have _d, _do, _r, and _do variants) do not require this
because the assembly name is not embedded in the source file.

An alternative to the renaming here would be to build the different IL variants with
different assembly names. Unfortunately, this isn't supported from the command line.
One possible option would be to create an IL source file with something like
#define ASSEMBLY_NAME "TESTNAME_il_d"
and add it to the _beginning_ of the IL source list (ilasm concatenates all source
files). Then change the test to include ".assembly ASSEMBLY_NAME".
-->
<!--
Note that because this file is included from Directory.Build.props (processed before
the main project file for a test), the project file can override this.
Directory.Build.targets is typically too late as SDK .targets files will have already
been processed and may have used the value.
-->
<AssemblyName Condition="'$(BuildAsStandalone)' != 'true'">$(MSBuildProjectName.Replace('_il_do', '').Replace('_il_d', '').Replace('_il_ro', '').Replace('_il_r', ''))</AssemblyName>
</PropertyGroup>
</Project>
10 changes: 2 additions & 8 deletions src/tests/JIT/Directed/Directed_1.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<MergedWrapperProjectReference Include="*/**/*.??proj" />
<MergedWrapperProjectReference Remove="PREFIX/**/*.??proj" />
<MergedWrapperProjectReference Remove="CheckedCtor/**/*.??proj" />
<MergedWrapperProjectReference Remove="coverage/**/*.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_d.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_do.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_r.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_ro.??proj" />
<MergedWrapperProjectReference Include="coverage/**/*.??proj" />
<MergedWrapperProjectReference Include="nullabletypes/**/*.??proj" />
</ItemGroup>

<Import Project="$(TestSourceDir)MergedTestRunner.targets" />
Expand Down
9 changes: 3 additions & 6 deletions src/tests/JIT/Directed/Directed_2.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<MergedWrapperProjectReference Include="cmov/**/*.??proj" />
<MergedWrapperProjectReference Include="perffix/**/*.??proj" />
<MergedWrapperProjectReference Include="PREFIX/**/*.??proj" />
<MergedWrapperProjectReference Include="CheckedCtor/**/*.??proj" />
<MergedWrapperProjectReference Include="coverage/**/*.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_d.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_do.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_r.??proj" />
<MergedWrapperProjectReference Remove="*/**/*_ro.??proj" />
<MergedWrapperProjectReference Include="shift/**/*.??proj" />
</ItemGroup>

<Import Project="$(TestSourceDir)MergedTestRunner.targets" />
Expand Down
17 changes: 17 additions & 0 deletions src/tests/JIT/Directed/Directed_3.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<MergedWrapperProjectReference Include="*/**/*.??proj" />

<!-- Directed_1 -->
<MergedWrapperProjectReference Remove="coverage/**/*.??proj" />
<MergedWrapperProjectReference Remove="nullabletypes/**/*.??proj" />

<!-- Directed_2 -->
<MergedWrapperProjectReference Remove="cmov/**/*.??proj" />
<MergedWrapperProjectReference Remove="perffix/**/*.??proj" />
<MergedWrapperProjectReference Remove="PREFIX/**/*.??proj" />
<MergedWrapperProjectReference Remove="shift/**/*.??proj" />
</ItemGroup>

<Import Project="$(TestSourceDir)MergedTestRunner.targets" />
</Project>
7 changes: 0 additions & 7 deletions src/tests/JIT/Directed/Directed_cs_r.csproj

This file was deleted.

7 changes: 0 additions & 7 deletions src/tests/JIT/Directed/Directed_cs_ro.csproj

This file was deleted.

7 changes: 0 additions & 7 deletions src/tests/JIT/Directed/Directed_d.csproj

This file was deleted.

7 changes: 0 additions & 7 deletions src/tests/JIT/Directed/Directed_do.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions src/tests/JIT/Directed/Directed_r.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions src/tests/JIT/Directed/Directed_ro.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion src/tests/JIT/Directed/UnrollLoop/loop3.il
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly 'loop3' {}
.assembly ASSEMBLY_NAME {}
.class private auto ansi beforefieldinit A
extends [mscorlib]System.Object
{
Expand Down
1 change: 1 addition & 0 deletions src/tests/JIT/Directed/UnrollLoop/loop3_d.il
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "loop3_d"
12 changes: 12 additions & 0 deletions src/tests/JIT/Directed/UnrollLoop/loop3_d.ilproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="loop3_d.il" />
<Compile Include="loop3.il" />
</ItemGroup>
</Project>
11 changes: 0 additions & 11 deletions src/tests/JIT/Directed/UnrollLoop/loop3_il_d.ilproj

This file was deleted.

9 changes: 0 additions & 9 deletions src/tests/JIT/Directed/UnrollLoop/loop3_il_r.ilproj

This file was deleted.

1 change: 1 addition & 0 deletions src/tests/JIT/Directed/UnrollLoop/loop3_r.il
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "loop3_r"
10 changes: 10 additions & 0 deletions src/tests/JIT/Directed/UnrollLoop/loop3_r.ilproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="loop3_r.il" />
<Compile Include="loop3.il" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.assembly extern mscorlib {}
.assembly extern xunit.core {}
.assembly badendfinally { }
.assembly ASSEMBLY_NAME { }
.method public static int32 f() noinlining
{
endfinally
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "badendfinally_d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>Full</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="badendfinally_d.il" />
<Compile Include="badendfinally.il" />
</ItemGroup>
</Project>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "badendfinally_r"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="badendfinally_r.il" />
<Compile Include="badendfinally.il" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.assembly extern mscorlib {}
.assembly extern xunit.core {}
.assembly 'badldsfld' { }
.assembly ASSEMBLY_NAME { }
.class public Test_badldsfld extends [mscorlib]System.Object
{
.field int32 i
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "badldsfld_d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>Full</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="badldsfld_d.il" />
<Compile Include="badldsfld.il" />
</ItemGroup>
</Project>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "badldsfld_r"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="badldsfld_r.il" />
<Compile Include="badldsfld.il" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.assembly extern mscorlib {}
.assembly extern xunit.core {}
.assembly badtailcall { }
.assembly ASSEMBLY_NAME { }
.method public static int32 f()
{
ldc.i4 100
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "badtailcall_d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="badtailcall_d.il" />
<Compile Include="badtailcall.il" />
</ItemGroup>
</Project>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "badtailcall_r"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="badtailcall_r.il" />
<Compile Include="badtailcall.il" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
.assembly extern xunit.core {}
.assembly extern legacy library mscorlib {}
.assembly byrefsubbyref1 { }
.assembly ASSEMBLY_NAME { }
.class public a extends [mscorlib]System.Object
{
.field static class ctest S_1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ASSEMBLY_NAME "byrefsubbyref1_d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="byrefsubbyref1_d.il" />
<Compile Include="byrefsubbyref1.il" />
</ItemGroup>
</Project>
Loading