forked from dotnet/linker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomWarningUsage.cs
More file actions
32 lines (29 loc) · 1.01 KB
/
CustomWarningUsage.cs
File metadata and controls
32 lines (29 loc) · 1.01 KB
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.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
namespace Mono.Linker.Tests.Cases.Extensibility
{
[SetupCompileBefore ("CustomWarning.dll", new[] { "Dependencies/CustomWarning.cs" }, new[] { "illink.dll", "Mono.Cecil.dll", "netstandard.dll" })]
[SetupLinkerArgument ("--custom-step", "CustomWarning,CustomWarning.dll")]
[SetupLinkerArgument ("--notrimwarn")]
[ExpectedNoWarnings]
public class CustomWarningUsage
{
[ExpectedWarning ("IL2026", "--RUCMethod--", ProducedBy = ProducedBy.Analyzer)]
public static void Main ()
{
new KnownTypeThatShouldWarn ();
RUCMethod (); // Warning suppressed by --notrimwarn
}
[ExpectedWarning ("IL6200", "custom warning on type")]
[Kept]
[KeptMember (".ctor()")]
public class KnownTypeThatShouldWarn
{
}
[Kept]
[KeptAttributeAttribute (typeof (RequiresUnreferencedCodeAttribute))]
[RequiresUnreferencedCode ("--RUCMethod--")]
static void RUCMethod () { }
}
}