blob: 2c3e4cebef42cc515716b45256eebf2da3f26621 (
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
47
48
49
|
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
{
/// <summary>
/// This is an acceptable bug with the currently implementation. Embedded link xml files will not be processed
/// </summary>
[IgnoreDescriptors (false)]
[SetupCompileBefore ("FakeSystemAssembly.dll", new[] { "Dependencies/PreserveDependencyAttribute.cs" })]
[SetupCompileBefore ("base.dll", new[] { "Dependencies/PreserveDependencyMethodInNonReferencedAssemblyBase.cs" })]
[SetupCompileBefore (
"PreserveDependencyMethodInNonReferencedAssemblyLibrary.dll",
new[] { "Dependencies/PreserveDependencyMethodInNonReferencedAssemblyLibrary.cs" },
references: new[] { "base.dll" },
resources: new object[] { "Dependencies/PreserveDependencyMethodInNonReferencedAssemblyLibrary.xml" },
addAsReference: false)]
[KeptAssembly ("base.dll")]
[RemovedMemberInAssembly ("PreserveDependencyMethodInNonReferencedAssemblyLibrary.dll", "Mono.Linker.Tests.Cases.PreserveDependencies.Dependencies.PreserveDependencyMethodInNonReferencedAssemblyLibrary", "UnusedMethod()")]
public class PreserveDependencyMethodInNonReferencedAssemblyWithEmbeddedXml
{
public static void Main ()
{
var obj = new Foo ();
var val = obj.Method ();
Dependency ();
}
[Kept]
[PreserveDependency (".ctor()", "Mono.Linker.Tests.Cases.PreserveDependencies.Dependencies.PreserveDependencyMethodInNonReferencedAssemblyLibrary", "PreserveDependencyMethodInNonReferencedAssemblyLibrary")]
static void Dependency ()
{
}
[Kept]
[KeptMember (".ctor()")]
[KeptBaseType (typeof (PreserveDependencyMethodInNonReferencedAssemblyBase))]
class Foo : PreserveDependencyMethodInNonReferencedAssemblyBase
{
[Kept]
public override string Method ()
{
return "Foo";
}
}
}
}
|