blob: ca5a14f43b3601397f3c875f785062f8c0cbc827 (
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
50
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Helpers;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
namespace Mono.Linker.Tests.Cases.Reflection
{
[SetupLinkerArgument ("-a", "test.exe", "library")]
[ExpectedNoWarnings]
[KeptMember (".ctor()")]
public class TypeHierarchyLibraryModeSuppressions
{
public static void Main ()
{
var t1 = typeof (Unsuppressed);
var t2 = typeof (Suppressed);
}
[Kept]
[KeptAttributeAttribute (typeof (DynamicallyAccessedMembersAttribute))]
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)]
class Unsuppressed
{
[Kept]
[KeptAttributeAttribute (typeof (RequiresUnreferencedCodeAttribute))]
[ExpectedWarning ("IL2112", "--RUC on Unsuppressed--")]
[RequiresUnreferencedCode ("--RUC on Unsuppressed--")]
public void RUCMethod () { }
}
[Kept]
[KeptAttributeAttribute (typeof (DynamicallyAccessedMembersAttribute))]
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)]
class Suppressed
{
[Kept]
[KeptAttributeAttribute (typeof (RequiresUnreferencedCodeAttribute))]
[KeptAttributeAttribute (typeof (UnconditionalSuppressMessageAttribute))]
[UnconditionalSuppressMessage ("TrimAnalysis", "IL2112")]
[RequiresUnreferencedCode ("--RUC on Suppressed--")]
public void RUCMethod () { }
}
}
}
|