diff --git a/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/ILCompilerOptionsBuilder.cs b/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/ILCompilerOptionsBuilder.cs index 8d8d8c55813a3..ce47eb5bbbae8 100644 --- a/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/ILCompilerOptionsBuilder.cs +++ b/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/ILCompilerOptionsBuilder.cs @@ -121,10 +121,6 @@ public virtual void AddLinkSymbols (string value) { } - public virtual void AddKeepDebugMembers (string value) - { - } - public virtual void AddAssemblyAction (string action, string assembly) { switch (action) { @@ -208,9 +204,6 @@ public virtual void ProcessOptions (TestCaseLinkerOptions options) if (!string.IsNullOrEmpty (options.LinkSymbols)) AddLinkSymbols (options.LinkSymbols); - if (!string.IsNullOrEmpty (options.KeepDebugMembers)) - AddKeepDebugMembers (options.KeepDebugMembers); - AddSkipUnresolved (options.SkipUnresolved); AddStripDescriptors (options.StripDescriptors); diff --git a/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs b/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs index d5b512ec32ffe..a92738ba9f25c 100644 --- a/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs +++ b/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs @@ -18,7 +18,6 @@ public class TestCaseLinkerOptions public bool IgnoreSubstitutions; public bool IgnoreLinkAttributes; public string KeepTypeForwarderOnlyAssemblies; - public string KeepDebugMembers; public string LinkSymbols; public bool SkipUnresolved; public bool StripDescriptors; diff --git a/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs b/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs index e7250abbee930..6aef3b5ba767d 100644 --- a/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs +++ b/src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs @@ -27,7 +27,6 @@ public virtual TestCaseLinkerOptions GetLinkerOptions (NPath inputPath) IgnoreSubstitutions = GetOptionAttributeValue (nameof (IgnoreSubstitutionsAttribute), true), IgnoreLinkAttributes = GetOptionAttributeValue (nameof (IgnoreLinkAttributesAttribute), true), KeepTypeForwarderOnlyAssemblies = GetOptionAttributeValue (nameof (KeepTypeForwarderOnlyAssembliesAttribute), string.Empty), - KeepDebugMembers = GetOptionAttributeValue (nameof (SetupLinkerKeepDebugMembersAttribute), string.Empty), LinkSymbols = GetOptionAttributeValue (nameof (SetupLinkerLinkSymbolsAttribute), string.Empty), TrimMode = GetOptionAttributeValue (nameof (SetupLinkerTrimModeAttribute), null), DefaultAssembliesAction = GetOptionAttributeValue (nameof (SetupLinkerDefaultActionAttribute), null), diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.Debugger.KeepDebugMembersTests.g.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.Debugger.KeepDebugMembersTests.g.cs index f9b9045f66fbc..cd4a3ed5f4ca6 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.Debugger.KeepDebugMembersTests.g.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.Debugger.KeepDebugMembersTests.g.cs @@ -63,6 +63,12 @@ public Task DebuggerDisplayAttributeOnTypeThatIsNotUsed () return RunTest (allowMissingWarnings: true); } + [Fact] + public Task DebuggerDisplayAttributeOnTypeWithNonExistentMethod () + { + return RunTest (allowMissingWarnings: true); + } + [Fact] public Task DebuggerDisplayOnTypeWithCallToExtensionMethodOnFieldType () { diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.DebuggerTests.g.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.DebuggerTests.g.cs index ce49d1c03588c..5cf889ee6cc7f 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.DebuggerTests.g.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Attributes.DebuggerTests.g.cs @@ -45,12 +45,6 @@ public Task DebuggerDisplayAttributeOnTypeThatIsNotUsed () return RunTest (allowMissingWarnings: true); } - [Fact] - public Task DebuggerDisplayAttributeOnTypeWithNonExistentMethod () - { - return RunTest (allowMissingWarnings: true); - } - [Fact] public Task DebuggerTypeProxyAttributeOnAssemblyUsingTarget () { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerKeepDebugMembersAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerKeepDebugMembersAttribute.cs deleted file mode 100644 index 2213b9cc551c7..0000000000000 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerKeepDebugMembersAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Mono.Linker.Tests.Cases.Expectations.Metadata -{ - [AttributeUsage (AttributeTargets.Class)] - public class SetupLinkerKeepDebugMembersAttribute : BaseMetadataAttribute - { - public SetupLinkerKeepDebugMembersAttribute (string value) - { - if (string.IsNullOrEmpty (value)) - throw new ArgumentException ("Value cannot be null or empty.", nameof (value)); - } - } -} \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs index 6514e8042ef58..a7f0c2b7bb8ab 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs @@ -3,26 +3,11 @@ using Mono.Linker.Tests.Cases.Expectations.Assertions; using Mono.Linker.Tests.Cases.Expectations.Metadata; -#if !NETCOREAPP -[assembly: KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] -#endif - [assembly: DebuggerDisplay ("{Property}", Target = typeof (DebuggerDisplayAttributeOnAssemblyUsingTarget.Foo))] namespace Mono.Linker.Tests.Cases.Attributes.Debugger { -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), ".ctor(System.String)")] - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), "set_Target(System.Type)")] -#endif public class DebuggerDisplayAttributeOnAssemblyUsingTarget { public static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs index 59b8fb6e90b28..033d1902dec28 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs @@ -1,23 +1,12 @@ using System.Diagnostics; using Mono.Linker.Tests.Cases.Attributes.Debugger; -using Mono.Linker.Tests.Cases.Expectations.Assertions; using Mono.Linker.Tests.Cases.Expectations.Metadata; [assembly: DebuggerDisplay ("{Property}", Target = typeof (DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.Foo))] namespace Mono.Linker.Tests.Cases.Attributes.Debugger { -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), ".ctor(System.String)")] -#endif public class DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType { public static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs index 7c81962e4ce5a..feff4274c490a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs @@ -3,28 +3,12 @@ using Mono.Linker.Tests.Cases.Expectations.Assertions; using Mono.Linker.Tests.Cases.Expectations.Metadata; -#if !NETCOREAPP -[assembly: KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] -#endif - [assembly: DebuggerDisplay ("{Property}", TargetTypeName = "Mono.Linker.Tests.Cases.Attributes.Debugger.Dependencies.DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib, library")] namespace Mono.Linker.Tests.Cases.Attributes.Debugger { [SetupCompileBefore ("library.dll", new[] { typeof (DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib) })] - -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), ".ctor(System.String)")] - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), "set_TargetTypeName(System.String)")] -#endif [RemovedMemberInAssembly ("library.dll", typeof (DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib), "get_Property()")] [KeptMemberInAssembly ("library.dll", typeof (DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib), "set_Property(System.Int32)")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnType.cs index a78ee540f86a1..2671331751e6e 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnType.cs @@ -4,17 +4,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger { -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), ".ctor(System.String)")] -#endif public class DebuggerDisplayAttributeOnType { public static void Main () @@ -26,9 +16,6 @@ public static void Main () [Kept] [KeptMember (".ctor()")] -#if !NETCOREAPP - [KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] -#endif [DebuggerDisplay ("{Property}")] class Foo { @@ -37,9 +24,6 @@ class Foo [Kept] [KeptMember (".ctor()")] -#if !NETCOREAPP - [KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] -#endif [DebuggerDisplay ("{Method()}")] class Bar { @@ -51,9 +35,6 @@ public int Method () [Kept] [KeptMember (".ctor()")] -#if !NETCOREAPP - [KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] -#endif [DebuggerDisplay (null)] class Baz { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs index 8df304176c402..ddd6a69161fd2 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs @@ -1,18 +1,9 @@ using System.Diagnostics; -using Mono.Linker.Tests.Cases.Expectations.Assertions; using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.Attributes.Debugger { -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] -#endif public class DebuggerDisplayAttributeOnTypeThatIsNotUsed { public static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeWithNonExistentMethod.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeWithNonExistentMethod.cs deleted file mode 100644 index 39d6d77b0fa25..0000000000000 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerDisplayAttributeOnTypeWithNonExistentMethod.cs +++ /dev/null @@ -1,39 +0,0 @@ -#define FLAG - -using System.Diagnostics; -using Mono.Linker.Tests.Cases.Expectations.Assertions; -using Mono.Linker.Tests.Cases.Expectations.Metadata; - -namespace Mono.Linker.Tests.Cases.Attributes.Debugger -{ -#if !NETCOREAPP - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerDisplayAttribute), ".ctor(System.String)")] -#endif - public class DebuggerDisplayAttributeOnTypeWithNonExistentMethod - { - public static void Main () - { - var bar = new Bar (); - } - - [Kept] - [KeptMember (".ctor()")] - [KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] - [DebuggerDisplay ("{Method()}")] - class Bar - { -#if !FLAG - public int Method () - { - return 1; - } -#endif - } - } -} \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs index 1a0c432b39fb4..6150082b0a156 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs @@ -3,25 +3,11 @@ using Mono.Linker.Tests.Cases.Expectations.Assertions; using Mono.Linker.Tests.Cases.Expectations.Metadata; -#if !NETCOREAPP -[assembly: KeptAttributeAttribute (typeof (DebuggerTypeProxyAttribute))] -#endif - [assembly: DebuggerTypeProxy (typeof (DebuggerTypeProxyAttributeOnAssemblyUsingTarget.Foo.FooDebugView), Target = typeof (DebuggerTypeProxyAttributeOnAssemblyUsingTarget.Foo))] namespace Mono.Linker.Tests.Cases.Attributes.Debugger { -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerTypeProxyAttribute), ".ctor(System.Type)")] -#endif public class DebuggerTypeProxyAttributeOnAssemblyUsingTarget { public static void Main () @@ -38,9 +24,6 @@ public class Foo [KeptBackingField] public int Property { get; [Kept] set; } -#if !NETCOREAPP - [Kept] -#endif internal class FooDebugView { private Foo _foo; diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnType.cs index b227081283267..d7909cf84e768 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/DebuggerTypeProxyAttributeOnType.cs @@ -4,17 +4,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger { -#if NETCOREAPP [SetupLinkAttributesFile ("DebuggerAttributesRemoved.xml")] -#else - [SetupLinkerTrimMode ("link")] - [SetupLinkerKeepDebugMembers ("false")] - - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 - [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] - - [KeptMemberInAssembly (PlatformAssemblies.CoreLib, typeof (DebuggerTypeProxyAttribute), ".ctor(System.Type)")] -#endif public class DebuggerTypeProxyAttributeOnType { public static void Main () @@ -24,17 +14,11 @@ public static void Main () [Kept] [KeptMember (".ctor()")] -#if !NETCOREAPP - [KeptAttributeAttribute (typeof (DebuggerTypeProxyAttribute))] -#endif [DebuggerTypeProxy (typeof (FooDebugView))] class Foo { } -#if !NETCOREAPP - [Kept] -#endif class FooDebugView { public FooDebugView (Foo foo) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs index f61b097c9effe..fca51b2ca563d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetOnUnusedType.cs @@ -9,9 +9,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs index 1bf43e9816b93..a1708e3073120 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly.cs @@ -11,9 +11,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif [SetupCompileBefore ("library.dll", new[] { "../Dependencies/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib.cs" })] // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfNestedTypeInOtherAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfNestedTypeInOtherAssembly.cs index ff05b5343300a..b7bf3b23f88c9 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfNestedTypeInOtherAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfNestedTypeInOtherAssembly.cs @@ -10,9 +10,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif [SetupCompileBefore ("library.dll", new[] { "../Dependencies/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib.cs" })] // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnGenerics.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnGenerics.cs index ea0c2e635ddf3..2d99b155d8e33 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnGenerics.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnGenerics.cs @@ -1,13 +1,8 @@ using System.Diagnostics; using Mono.Linker.Tests.Cases.Expectations.Assertions; -using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] public class DebuggerDisplayAttributeOnGenerics diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnType.cs index 74ab32ff84342..5db37132917ac 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnType.cs @@ -6,10 +6,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeWithNonExistentMethod.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeWithNonExistentMethod.cs new file mode 100644 index 0000000000000..1673831caaff6 --- /dev/null +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeWithNonExistentMethod.cs @@ -0,0 +1,29 @@ +#define FLAG + +using System.Diagnostics; +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers +{ + public class DebuggerDisplayAttributeOnTypeWithNonExistentMethod + { + public static void Main () + { + var bar = new Bar (); + } + + [Kept] + [KeptMember (".ctor()")] + [KeptAttributeAttribute (typeof (DebuggerDisplayAttribute))] + [DebuggerDisplay ("{Method()}")] + class Bar + { +#if !FLAG + public int Method () + { + return 1; + } +#endif + } + } +} \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs index d6304e58b517d..d448bfe25c4c5 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnAssemblyUsingTarget.cs @@ -10,9 +10,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnType.cs index 7a12b0399f6ff..bf815b4a37276 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerTypeProxyAttributeOnType.cs @@ -6,10 +6,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP - [SetupLinkerKeepDebugMembers ("true")] -#endif - // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 [SkipPeVerify (SkipPeVerifyForToolchian.Pedump)] diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs index ae0673e9903ad..3164478220714 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs @@ -106,12 +106,6 @@ public virtual void AddLinkSymbols (string value) Append (value); } - public virtual void AddKeepDebugMembers (string value) - { - Append ("-v"); - Append (value); - } - public virtual void AddAssemblyAction (string action, string assembly) { Append ("--action"); @@ -219,9 +213,6 @@ public virtual void ProcessOptions (TestCaseLinkerOptions options) if (!string.IsNullOrEmpty (options.LinkSymbols)) AddLinkSymbols (options.LinkSymbols); - if (!string.IsNullOrEmpty (options.KeepDebugMembers)) - AddKeepDebugMembers (options.KeepDebugMembers); - AddSkipUnresolved (options.SkipUnresolved); AddStripDescriptors (options.StripDescriptors); diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs index 67b29656e8622..de2f030193d15 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs @@ -15,7 +15,6 @@ public class TestCaseLinkerOptions public bool IgnoreDescriptors; public bool IgnoreSubstitutions; public bool IgnoreLinkAttributes; - public string KeepDebugMembers; public string LinkSymbols; public bool SkipUnresolved; public bool StripDescriptors; diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs index 6f0ba6d0c1f92..ae2a1deb33f36 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs @@ -27,7 +27,6 @@ public virtual TestCaseLinkerOptions GetLinkerOptions (NPath inputPath) IgnoreDescriptors = GetOptionAttributeValue (nameof (IgnoreDescriptorsAttribute), true), IgnoreSubstitutions = GetOptionAttributeValue (nameof (IgnoreSubstitutionsAttribute), true), IgnoreLinkAttributes = GetOptionAttributeValue (nameof (IgnoreLinkAttributesAttribute), true), - KeepDebugMembers = GetOptionAttributeValue (nameof (SetupLinkerKeepDebugMembersAttribute), string.Empty), LinkSymbols = GetOptionAttributeValue (nameof (SetupLinkerLinkSymbolsAttribute), string.Empty), TrimMode = GetOptionAttributeValue (nameof (SetupLinkerTrimModeAttribute), null), DefaultAssembliesAction = GetOptionAttributeValue (nameof (SetupLinkerDefaultActionAttribute), null),