blob: 9f167aef26a21d6b8151791e9aab200fdfa5bcd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics.CodeAnalysis;
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
{
[SetupLinkerAction ("copyused", "Forwarder")]
[KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.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 ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })]
// https://github.com/mono/linker/issues/1536
//[KeptMemberInAssembly ("Forwarder.dll", typeof (ImplementationLibrary))]
[KeptTypeInAssembly ("Implementation.dll", typeof (ImplementationLibrary))]
class UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed
{
static void Main ()
{
PointToTypeInFacade ("Mono.Linker.Tests.Cases.TypeForwarding.OuterGeneric`1[[Mono.Linker.Tests.Cases.TypeForwarding.Dependencies.ImplementationLibrary, Forwarder]], test");
}
[Kept]
static void PointToTypeInFacade (
[KeptAttributeAttribute (typeof(DynamicallyAccessedMembersAttribute))]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] string typeName)
{
}
}
[Kept]
class OuterGeneric<T>
{
[Kept]
public OuterGeneric () { }
}
}
|