-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2391 from vitek-karas/FixTypeForwarders6
[release/6.0.2xx] Fix marking of nested type forwarders
- Loading branch information
Showing
8 changed files
with
184 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/Mono.Linker.Tests.Cases/TypeForwarding/Dependencies/NestedForwarderLibrary.il
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.assembly extern mscorlib | ||
{ | ||
} | ||
|
||
.assembly extern Implementation | ||
{ | ||
} | ||
|
||
.assembly NestedForwarderLibrary | ||
{ | ||
} | ||
|
||
.class extern forwarder Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.ImplementationLibrary | ||
{ | ||
.assembly extern 'Implementation' | ||
} | ||
.class extern ForwardedNestedType | ||
{ | ||
.class extern 'Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.ImplementationLibrary' | ||
} | ||
|
||
.class extern forwarder Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.AnotherImplementationClass | ||
{ | ||
.assembly extern 'Implementation' | ||
} | ||
.class extern ForwardedNestedType | ||
{ | ||
.class extern 'Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.AnotherImplementationClass' | ||
} | ||
|
||
.module 'NestedForwarderLibrary.dll' |
31 changes: 31 additions & 0 deletions
31
test/Mono.Linker.Tests.Cases/TypeForwarding/Dependencies/NestedForwarderLibrary_2.il
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.assembly extern mscorlib | ||
{ | ||
} | ||
|
||
.assembly extern NestedForwarderLibrary | ||
{ | ||
} | ||
|
||
.assembly NestedForwarderLibrary_2 | ||
{ | ||
} | ||
|
||
.class extern forwarder Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.ImplementationLibrary | ||
{ | ||
.assembly extern 'NestedForwarderLibrary' | ||
} | ||
.class extern ForwardedNestedType | ||
{ | ||
.class extern 'Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.ImplementationLibrary' | ||
} | ||
|
||
.class extern forwarder Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.AnotherImplementationClass | ||
{ | ||
.assembly extern 'NestedForwarderLibrary' | ||
} | ||
.class extern ForwardedNestedType | ||
{ | ||
.class extern 'Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.AnotherImplementationClass' | ||
} | ||
|
||
.module 'NestedForwarderLibrary_2.dll' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/Mono.Linker.Tests.Cases/TypeForwarding/MultiForwardedTypesWithCopyUsed.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.TypeForwarding | ||
{ | ||
[SkipUnresolved (true)] | ||
|
||
[SetupCompileBefore ("NestedForwarderLibrary_2.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] | ||
|
||
// After compiling the test case we then replace the reference impl with implementation + type forwarder | ||
[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] | ||
[SetupCompileAfter ("NestedForwarderLibrary.dll", new[] { "Dependencies/NestedForwarderLibrary.il" }, references: new[] { "Implementation.dll" })] | ||
[SetupCompileAfter ("NestedForwarderLibrary_2.dll", new[] { "Dependencies/NestedForwarderLibrary_2.il" }, references: new[] { "NestedForwarderLibrary.dll" })] | ||
|
||
[SetupLinkerAction ("copy", "test")] | ||
[SetupLinkerAction ("copy", "NestedForwarderLibrary_2")] | ||
[SetupLinkerAction ("copyused", "NestedForwarderLibrary")] | ||
[SetupLinkerAction ("copyused", "Implementation")] | ||
|
||
[KeptTypeInAssembly ("NestedForwarderLibrary.dll", typeof (ImplementationLibrary.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("NestedForwarderLibrary.dll", typeof (AnotherImplementationClass.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("NestedForwarderLibrary_2.dll", typeof (ImplementationLibrary.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("NestedForwarderLibrary_2.dll", typeof (AnotherImplementationClass.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("Implementation.dll", typeof (ImplementationLibrary.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("Implementation.dll", typeof (AnotherImplementationClass.ForwardedNestedType))] | ||
|
||
[KeptMember (".ctor()")] | ||
class MultiForwardedTypesWithCopyUsed | ||
{ | ||
static void Main () | ||
{ | ||
Console.WriteLine (typeof (ImplementationLibrary.ForwardedNestedType).FullName); | ||
Console.WriteLine (typeof (AnotherImplementationClass.ForwardedNestedType).FullName); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
test/Mono.Linker.Tests.Cases/TypeForwarding/MultiForwardedTypesWithLink.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.TypeForwarding | ||
{ | ||
[SkipUnresolved (true)] | ||
|
||
[SetupCompileBefore ("NestedForwarderLibrary_2.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] | ||
|
||
// After compiling the test case we then replace the reference impl with implementation + type forwarder | ||
[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] | ||
[SetupCompileAfter ("NestedForwarderLibrary.dll", new[] { "Dependencies/NestedForwarderLibrary.il" }, references: new[] { "Implementation.dll" })] | ||
[SetupCompileAfter ("NestedForwarderLibrary_2.dll", new[] { "Dependencies/NestedForwarderLibrary_2.il" }, references: new[] { "NestedForwarderLibrary.dll" })] | ||
|
||
[SetupLinkerAction ("copy", "test")] | ||
[SetupLinkerAction ("copy", "NestedForwarderLibrary_2")] | ||
[SetupLinkerAction ("link", "NestedForwarderLibrary")] | ||
[SetupLinkerAction ("link", "Implementation")] | ||
|
||
[KeptTypeInAssembly ("NestedForwarderLibrary.dll", typeof (ImplementationLibrary.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("NestedForwarderLibrary.dll", typeof (AnotherImplementationClass.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("NestedForwarderLibrary_2.dll", typeof (ImplementationLibrary.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("NestedForwarderLibrary_2.dll", typeof (AnotherImplementationClass.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("Implementation.dll", typeof (ImplementationLibrary.ForwardedNestedType))] | ||
[KeptTypeInAssembly ("Implementation.dll", typeof (AnotherImplementationClass.ForwardedNestedType))] | ||
|
||
[KeptMember (".ctor()")] | ||
class MultiForwardedTypesWithLink | ||
{ | ||
static void Main () | ||
{ | ||
Console.WriteLine (typeof (ImplementationLibrary.ForwardedNestedType).FullName); | ||
Console.WriteLine (typeof (AnotherImplementationClass.ForwardedNestedType).FullName); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters