blob: 68f70d9d839c5c87e63e238fd99c3de4483282ac (
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
|
using System.Runtime.CompilerServices;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
using Mono.Linker.Tests.Cases.PreserveDependencies.Dependencies;
namespace Mono.Linker.Tests.Cases.PreserveDependencies
{
[SetupCompileBefore ("FakeSystemAssembly.dll", new[] { "Dependencies/PreserveDependencyAttribute.cs" })]
[SetupCompileBefore ("base.dll", new[] { "Dependencies/PreserveDependencyMethodInNonReferencedAssemblyBase.cs" })]
[SetupCompileBefore ("library.dll", new[] { "Dependencies/PreserveDependencyMethodInNonReferencedAssemblyLibrary.cs" }, references: new[] { "base.dll" }, addAsReference: false)]
[KeptAssembly ("base.dll")]
[KeptAssembly ("library.dll")]
[KeptMemberInAssembly ("base.dll", typeof (PreserveDependencyMethodInNonReferencedAssemblyBase), "Method()")]
[KeptMemberInAssembly ("library.dll", "Mono.Linker.Tests.Cases.PreserveDependencies.Dependencies.PreserveDependencyMethodInNonReferencedAssemblyLibrary", "Method()")]
public class PreserveDependencyMethodInNonReferencedAssembly
{
public static void Main ()
{
var obj = new Foo ();
var val = obj.Method ();
Dependency ();
}
[Kept]
[PreserveDependency (".ctor()", "Mono.Linker.Tests.Cases.PreserveDependencies.Dependencies.PreserveDependencyMethodInNonReferencedAssemblyLibrary", "library")]
static void Dependency ()
{
}
[Kept]
[KeptMember (".ctor()")]
[KeptBaseType (typeof (PreserveDependencyMethodInNonReferencedAssemblyBase))]
class Foo : PreserveDependencyMethodInNonReferencedAssemblyBase
{
[Kept]
public override string Method ()
{
return "Foo";
}
}
}
}
|