blob: 4fca50cfaa0edb888e8f2f268d91b3863d5bf407 (
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
|
using System.Diagnostics.CodeAnalysis;
using Mono.Linker.Tests.Cases.DynamicDependencies.Dependencies;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
namespace Mono.Linker.Tests.Cases.DynamicDependencies
{
[SetupCSharpCompilerToUse ("csc")]
[SetupCompileBefore ("unusedreference.dll", new[] { "Dependencies/UnusedAssemblyDependency.cs" })]
[SetupCompileBefore ("reference.dll", new[] { "Dependencies/AssemblyDependency.cs" }, addAsReference: false)]
[SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyDependencyWithMultipleReferences.cs" }, new[] { "reference.dll", "unusedreference.dll" }, addAsReference: false)]
// TODO: keep library even if type is not found in it (https://github.com/dotnet/linker/issues/1795)
// [KeptAssembly ("library")]
public class DynamicDependencyMethodInNonReferencedAssemblyWithSweptReferences
{
public static void Main ()
{
DynamicDependencyOnNonExistingTypeInAssembly ();
}
[Kept]
[DynamicDependency ("#ctor()", "DoesntExist", "library")]
static void DynamicDependencyOnNonExistingTypeInAssembly ()
{
}
static void ReferenceUnusedAssemblyDependency ()
{
UnusedAssemblyDependency.UsedToKeepReferenceAtCompileTime ();
}
}
}
|