diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceVariants.cs | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceVariants.cs b/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceVariants.cs index 9b766b42a..de7f5a537 100644 --- a/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceVariants.cs +++ b/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceVariants.cs @@ -20,9 +20,8 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces t = typeof (UninstantiatedClassWithImplicitlyImplementedInterface); t = typeof (UninstantiatedPublicClassWithPrivateInterface); t = typeof (ImplementsUsedStaticInterface.InterfaceMethodUnused); - t = typeof (ImplementsUnusedStaticInterface.InterfaceMethodUnused); - ImplementsUnusedStaticInterface.InterfaceMethodUsedThroughImplementation.InternalStaticInterfaceMethodUsedThroughImplementation (); + ImplementsUnusedStaticInterface.Test (); ; GenericMethodThatCallsInternalStaticInterfaceMethod <ImplementsUsedStaticInterface.InterfaceMethodUsedThroughInterface> (); // Use all public interfaces - they're marked as public only to denote them as "used" @@ -66,21 +65,53 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces } } + [Kept] internal class ImplementsUnusedStaticInterface { [Kept] - internal class InterfaceMethodUsedThroughImplementation : IStaticInterfaceUnused + // The interface methods themselves are not used, but the implementation of these methods is + internal interface IStaticInterfaceMethodUnused + { + static abstract void InterfaceUsedMethodNot (); + } + + // The interface methods themselves are not used, but the implementation of these methods is + internal interface IStaticInterfaceUnused + { + static abstract void InterfaceAndMethodNoUsed (); + } + + [Kept] + internal class InterfaceMethodUsedThroughImplementation : IStaticInterfaceMethodUnused, IStaticInterfaceUnused { [Kept] + [RemovedOverride (typeof (IStaticInterfaceMethodUnused))] + public static void InterfaceUsedMethodNot () { } + + [Kept] [RemovedOverride (typeof (IStaticInterfaceUnused))] - public static void InternalStaticInterfaceMethodUsedThroughImplementation () { } + public static void InterfaceAndMethodNoUsed () { } } [Kept] - internal class InterfaceMethodUnused : IStaticInterfaceUnused + [KeptInterface (typeof (IStaticInterfaceMethodUnused))] + internal class InterfaceMethodUnused : IStaticInterfaceMethodUnused, IStaticInterfaceUnused { - public static void InternalStaticInterfaceMethodUsedThroughImplementation () { } + public static void InterfaceUsedMethodNot () { } + + public static void InterfaceAndMethodNoUsed () { } + } + + [Kept] + public static void Test () + { + InterfaceMethodUsedThroughImplementation.InterfaceUsedMethodNot (); + InterfaceMethodUsedThroughImplementation.InterfaceAndMethodNoUsed (); + + Type t; + t = typeof (IStaticInterfaceMethodUnused); + t = typeof (InterfaceMethodUnused); } } @@ -270,12 +301,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces static abstract void ExplicitImplementationInternalStaticInterfaceMethod (); } - // The interface methods themselves are not used, but the implementation of these methods is - internal interface IStaticInterfaceUnused - { - static abstract void InternalStaticInterfaceMethodUsedThroughImplementation (); - } - // The interface methods themselves are used through the interface [Kept] internal interface IStaticInterfaceUsed |