diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs index 46120679c..f6747be82 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs @@ -16,9 +16,11 @@ namespace Mono.Linker.Tests.Cases.DataFlow { [KeptAttributeAttribute (typeof (KeepsPublicConstructorAttribute))] [KeptAttributeAttribute (typeof (KeepsPublicMethodsAttribute))] + [KeptAttributeAttribute (typeof (KeepsPublicFieldsAttribute))] [KeptAttributeAttribute (typeof (TypeArrayAttribute))] [KeepsPublicConstructor (typeof (ClassWithKeptPublicConstructor))] [KeepsPublicMethods ("Mono.Linker.Tests.Cases.DataFlow.AttributeConstructorDataflow+ClassWithKeptPublicMethods")] + [KeepsPublicFields (null, null)] [TypeArray (new Type[] { typeof (AttributeConstructorDataflow) })] // Trimmer only for now - https://github.com/dotnet/linker/issues/2273 [ExpectedWarning ("IL2026", "--ClassWithKeptPublicMethods--", ProducedBy = ProducedBy.Trimmer)] @@ -55,6 +57,23 @@ namespace Mono.Linker.Tests.Cases.DataFlow } } + // Used to test null parameter values + [Kept] + [KeptBaseType (typeof (Attribute))] + class KeepsPublicFieldsAttribute : Attribute + { + [Kept] + public KeepsPublicFieldsAttribute ( + [KeptAttributeAttribute(typeof(DynamicallyAccessedMembersAttribute))] + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] + Type type, + [KeptAttributeAttribute(typeof(DynamicallyAccessedMembersAttribute))] + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] + string typeName) + { + } + } + [Kept] class ClassWithKeptPublicConstructor { |