diff --git a/src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets b/src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets index 8f009acd7862d6..3ba13f1f5ad329 100644 --- a/src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets +++ b/src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets @@ -221,7 +221,6 @@ Copyright (c) .NET Foundation. All rights reserved. $(TreatWarningsAsErrors) - <_ExtraTrimmerArgs>--skip-unresolved true $(_ExtraTrimmerArgs) true diff --git a/src/tools/illink/src/linker/CompatibilitySuppressions.xml b/src/tools/illink/src/linker/CompatibilitySuppressions.xml index b8ea0dc7ffdb61..cd9e7f0a1fc3e9 100644 --- a/src/tools/illink/src/linker/CompatibilitySuppressions.xml +++ b/src/tools/illink/src/linker/CompatibilitySuppressions.xml @@ -1387,12 +1387,6 @@ ref/net8.0/illink.dll lib/net8.0/illink.dll - - CP0002 - M:Mono.Linker.LinkContext.get_IgnoreUnresolved - ref/net8.0/illink.dll - lib/net8.0/illink.dll - CP0002 M:Mono.Linker.LinkContext.get_KeepUsedAttributeTypesOnly @@ -1831,12 +1825,6 @@ ref/net8.0/illink.dll lib/net8.0/illink.dll - - CP0002 - M:Mono.Linker.LinkContext.set_IgnoreUnresolved(System.Boolean) - ref/net8.0/illink.dll - lib/net8.0/illink.dll - CP0002 M:Mono.Linker.LinkContext.set_KeepUsedAttributeTypesOnly(System.Boolean) diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkExportedTypesTargetStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkExportedTypesTargetStep.cs index 6b10b0659f8381..46ec5e0e40008a 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkExportedTypesTargetStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkExportedTypesTargetStep.cs @@ -25,11 +25,9 @@ static void InitializeExportedType (ExportedType exportedType, LinkContext conte if (!context.Annotations.TryGetPreservedMembers (exportedType, out TypePreserveMembers members)) return; - TypeDefinition? type = context.TryResolve (exportedType); + TypeDefinition? type = context.TryResolve (exportedType, assembly.MainModule); if (type == null) { - if (!context.IgnoreUnresolved) - context.LogError (null, DiagnosticId.ExportedTypeCannotBeResolved, exportedType.Name); - + context.LogError (null, DiagnosticId.ExportedTypeCannotBeResolved, exportedType.Name); return; } diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs index ded92af4ba507f..d469a5eef80a2f 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs @@ -1470,7 +1470,7 @@ protected override void ProcessTypeReference (TypeReference type) markingHelpers.MarkForwardedScope (type, new MessageOrigin (assembly)); } - protected override void ProcessExportedType (ExportedType exportedType) + protected override void ProcessExportedType (ExportedType exportedType, ModuleDefinition module) { markingHelpers.MarkExportedType (exportedType, assembly.MainModule, new DependencyInfo (DependencyKind.ExportedType, assembly), new MessageOrigin (assembly)); markingHelpers.MarkForwardedScope (CreateTypeReferenceForExportedTypeTarget (exportedType), new MessageOrigin (assembly)); diff --git a/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs b/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs index e96ce5a22f5250..84ec1d9b0a0add 100644 --- a/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs +++ b/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs @@ -191,7 +191,7 @@ protected virtual void ProcessTypes (AssemblyDefinition assembly, XPathNavigator } } - protected virtual TypeDefinition? ProcessExportedType (ExportedType exported, AssemblyDefinition assembly, XPathNavigator nav) => _context.TryResolve (exported); + protected virtual TypeDefinition? ProcessExportedType (ExportedType exported, AssemblyDefinition assembly, XPathNavigator nav) => _context.TryResolve (exported, assembly.MainModule); void MatchType (TypeDefinition type, Regex regex, XPathNavigator nav) { diff --git a/src/tools/illink/src/linker/Linker.Steps/SweepStep.cs b/src/tools/illink/src/linker/Linker.Steps/SweepStep.cs index 794ef60ea19a76..6551c59a092d43 100644 --- a/src/tools/illink/src/linker/Linker.Steps/SweepStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/SweepStep.cs @@ -612,9 +612,8 @@ protected override void ProcessTypeReference (TypeReference type) #pragma warning restore RS0030 if (td == null) { // - // This can happen when not all assembly refences were provided and we - // run in `--skip-unresolved` mode. We cannot fully sweep and keep the - // original assembly reference + // This can happen when not all assembly refences were provided. + // We cannot fully sweep and keep the original assembly reference. // var anr = (AssemblyNameReference) type.Scope; type.Scope = importer.ImportReference (anr); @@ -629,14 +628,13 @@ protected override void ProcessTypeReference (TypeReference type) ChangedAnyScopes = true; } - protected override void ProcessExportedType (ExportedType exportedType) + protected override void ProcessExportedType (ExportedType exportedType, ModuleDefinition module) { #pragma warning disable RS0030 // Cecil's Resolve is banned -- it's necessary when the metadata graph is unstable - TypeDefinition? td = exportedType.Resolve (); + TypeDefinition? td = exportedType.TryResolve (module); #pragma warning restore RS0030 if (td == null) { - // Forwarded type cannot be resolved but it was marked - // ILLink is running in --skip-unresolved true mode + // Forwarded type cannot be resolved but it was marked. var anr = (AssemblyNameReference) exportedType.Scope; exportedType.Scope = importer.ImportReference (anr); return; diff --git a/src/tools/illink/src/linker/Linker/AssemblyResolver.cs b/src/tools/illink/src/linker/Linker/AssemblyResolver.cs index dc654fdeb9cd15..cf903d45522bac 100644 --- a/src/tools/illink/src/linker/Linker/AssemblyResolver.cs +++ b/src/tools/illink/src/linker/Linker/AssemblyResolver.cs @@ -124,10 +124,7 @@ void ReportUnresolvedAssembly (AssemblyNameReference reference) if (!_reportedUnresolvedAssemblies.Add (reference.Name)) return; - if (_context.IgnoreUnresolved) - _context.LogMessage ($"Ignoring unresolved assembly '{reference.Name}' reference."); - else - _context.LogError (null, DiagnosticId.CouldNotFindAssemblyReference, reference.Name); + _context.LogError (null, DiagnosticId.CouldNotFindAssemblyReference, reference.Name); } public void AddSearchDirectory (string directory) diff --git a/src/tools/illink/src/linker/Linker/Driver.cs b/src/tools/illink/src/linker/Linker/Driver.cs index 695b76c6df6c32..c40e92c52ecc03 100644 --- a/src/tools/illink/src/linker/Linker/Driver.cs +++ b/src/tools/illink/src/linker/Linker/Driver.cs @@ -217,12 +217,6 @@ protected int SetupContext (ILogger? customLogger = null) Usage (); return 1; - case "--skip-unresolved": - if (!GetBoolParam (token, l => context.IgnoreUnresolved = l)) - return -1; - - continue; - case "--verbose": context.LogMessages = true; continue; @@ -1336,7 +1330,6 @@ static void Usage () Console.WriteLine (" --custom-data KEY=VALUE Populates context data set with user specified key-value pair"); Console.WriteLine (" --deterministic Produce a deterministic output for modified assemblies"); Console.WriteLine (" --ignore-descriptors Skips reading embedded descriptors (short -z). Defaults to false"); - Console.WriteLine (" --skip-unresolved Ignore unresolved types, methods, and assemblies. Defaults to false"); Console.WriteLine (" --output-pinvokes PATH Output a JSON file with all modules and entry points of the P/Invokes found"); Console.WriteLine (" --verbose Log messages indicating progress and warnings"); Console.WriteLine (" --nowarn WARN Disable specific warning messages"); diff --git a/src/tools/illink/src/linker/Linker/ExportedTypeExtensions.cs b/src/tools/illink/src/linker/Linker/ExportedTypeExtensions.cs new file mode 100644 index 00000000000000..8ea6675715eaa5 --- /dev/null +++ b/src/tools/illink/src/linker/Linker/ExportedTypeExtensions.cs @@ -0,0 +1,123 @@ +// 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; +using Mono.Cecil; + +namespace Mono.Linker; + +public static class ExportedTypeExtensions { + + // Logic copied from cecil, to allow resolving exported types without errors on assembly resolution failures. + // This replaces the call to AssemblyResolver.Resolve (which logs errors on resolution failure) with a call to + // an overload that doesn't log errors. + // The ModuleDefinition containing the ExportedType must be passed in because it is not accessible + // on ExportedType. + public static TypeDefinition? TryResolve (this ExportedType exportedType, ModuleDefinition module) { + // Note: the cast from IMetadataResolver to Metadataresolver should always succeed because cecil only + // creates a MetadataResolver. + return ((MetadataResolver) module.MetadataResolver).TryResolve (exportedType.CreateReference (module)); + } + + private static TypeReference CreateReference (this ExportedType exportedType, ModuleDefinition module) { + return new TypeReference (exportedType.Namespace, exportedType.Name, module, exportedType.Scope) { + DeclaringType = exportedType.DeclaringType?.CreateReference (module), + }; + } + + private static TypeDefinition? TryResolve (this MetadataResolver metadataResolver, TypeReference type) { + type = type.GetElementType (); + + var scope = type.Scope; + + if (scope == null) + return null; + + switch (scope.MetadataScopeType) { + case MetadataScopeType.AssemblyNameReference: + // Note: the cast to AssemblyResolver assumes that the IAssemblyResolver we get back from cecil + // is the same one that we originally passed in using ReaderParameters. + var assembly = ((AssemblyResolver) metadataResolver.AssemblyResolver).Resolve ((AssemblyNameReference) scope, probing: true); + if (assembly == null) + return null; + + return metadataResolver.GetType (assembly.MainModule, type); + case MetadataScopeType.ModuleDefinition: + return metadataResolver.GetType ((ModuleDefinition) scope, type); + case MetadataScopeType.ModuleReference: + if (type.Module.Assembly == null) + return null; + + var modules = type.Module.Assembly.Modules; + var module_ref = (ModuleReference) scope; + for (int i = 0; i < modules.Count; i++) { + var netmodule = modules [i]; + if (netmodule.Name == module_ref.Name) + return metadataResolver.GetType (netmodule, type); + } + break; + } + + throw new NotSupportedException (); + } + + private static TypeDefinition? GetType (this MetadataResolver metadataResolver, ModuleDefinition module, TypeReference reference) { + var type = metadataResolver.GetTypeDefinition (module, reference); + if (type != null) + return type; + + if (!module.HasExportedTypes) + return null; + + var exported_types = module.ExportedTypes; + + for (int i = 0; i < exported_types.Count; i++) { + var exported_type = exported_types [i]; + if (exported_type.Name != reference.Name) + continue; + + if (exported_type.Namespace != reference.Namespace) + continue; + + return exported_type.TryResolve (module); + } + + return null; + } + + private static TypeDefinition? GetTypeDefinition (this MetadataResolver metadtaaResolver, ModuleDefinition module, TypeReference type) + { + if (!type.IsNested) + return module.GetType (type.Namespace, type.Name); + + var declaring_type = metadtaaResolver.TryResolve (type.DeclaringType); + if (declaring_type == null) + return null; + + return declaring_type.GetNestedType (type.TypeFullName ()); + } + + private static string TypeFullName (this TypeReference self) + { + return string.IsNullOrEmpty (self.Namespace) + ? self.Name + : self.Namespace + '.' + self.Name; + } + + private static TypeDefinition? GetNestedType (this TypeDefinition self, string fullname) + { + if (!self.HasNestedTypes) + return null; + + var nested_types = self.NestedTypes; + + for (int i = 0; i < nested_types.Count; i++) { + var nested_type = nested_types [i]; + + if (nested_type.TypeFullName () == fullname) + return nested_type; + } + + return null; + } +} diff --git a/src/tools/illink/src/linker/Linker/LinkContext.cs b/src/tools/illink/src/linker/Linker/LinkContext.cs index 8de76753dce6fe..2b423b47c9e7c2 100644 --- a/src/tools/illink/src/linker/Linker/LinkContext.cs +++ b/src/tools/illink/src/linker/Linker/LinkContext.cs @@ -108,8 +108,6 @@ public Pipeline Pipeline { public readonly bool KeepMembersForDebugger = true; - public bool IgnoreUnresolved { get; set; } - public bool EnableReducedTracing { get; set; } public bool KeepUsedAttributeTypesOnly { get; set; } @@ -291,6 +289,12 @@ public bool HasFeatureValue (string feature, bool value) return _resolver.Resolve (reference); } + public AssemblyDefinition? TryResolve (IMetadataScope scope) + { + AssemblyNameReference reference = GetReference (scope); + return _resolver.Resolve (reference, probing: true); + } + public AssemblyDefinition? Resolve (AssemblyNameReference name) { return _resolver.Resolve (name); @@ -344,7 +348,7 @@ public virtual ICollection ResolveReferences (AssemblyDefini return references; foreach (AssemblyNameReference reference in assembly.MainModule.AssemblyReferences) { - AssemblyDefinition? definition = Resolve (reference); + AssemblyDefinition? definition = TryResolve (reference); if (definition != null) references.Add (definition); } @@ -774,7 +778,7 @@ public int GetTargetRuntimeVersion () #pragma warning disable RS0030 // Cecil's resolve is banned -- this provides the wrapper md = methodReference.Resolve (); #pragma warning restore RS0030 - if (md == null && !IgnoreUnresolved) + if (md == null) ReportUnresolved (methodReference); methodresolveCache.Add (methodReference, md); @@ -817,7 +821,7 @@ public int GetTargetRuntimeVersion () return fd; fd = fieldReference.Resolve (); - if (fd == null && !IgnoreUnresolved) + if (fd == null) ReportUnresolved (fieldReference); fieldresolveCache.Add (fieldReference, fd); @@ -866,7 +870,7 @@ public int GetTargetRuntimeVersion () #pragma warning disable RS0030 td = typeReference.Resolve (); #pragma warning restore RS0030 - if (td == null && !IgnoreUnresolved) + if (td == null) ReportUnresolved (typeReference); typeresolveCache.Add (typeReference, td); @@ -909,9 +913,9 @@ public int GetTargetRuntimeVersion () /// /// Tries to resolve the ExportedType to a TypeDefinition and logs a warning if it can't /// - public TypeDefinition? Resolve (ExportedType et) + public TypeDefinition? Resolve (ExportedType et, ModuleDefinition module) { - if (TryResolve (et) is not TypeDefinition td) { + if (TryResolve (et, module) is not TypeDefinition td) { ReportUnresolved (et); return null; } @@ -921,13 +925,13 @@ public int GetTargetRuntimeVersion () /// /// Tries to resolve the ExportedType to a TypeDefinition and returns null if it can't /// - public TypeDefinition? TryResolve (ExportedType et) + public TypeDefinition? TryResolve (ExportedType et, ModuleDefinition module) { if (exportedTypeResolveCache.TryGetValue (et, out var td)) { return td; } #pragma warning disable RS0030 // Cecil's Resolve is banned -- this method provides the wrapper - td = et.Resolve (); + td = et.TryResolve (module); #pragma warning restore RS0030 exportedTypeResolveCache.Add (et, td); return td; diff --git a/src/tools/illink/src/linker/Linker/MarkingHelpers.cs b/src/tools/illink/src/linker/Linker/MarkingHelpers.cs index 746722625ecd88..56fcdff82bc33b 100644 --- a/src/tools/illink/src/linker/Linker/MarkingHelpers.cs +++ b/src/tools/illink/src/linker/Linker/MarkingHelpers.cs @@ -37,7 +37,7 @@ public void MarkForwardedScope (TypeReference typeReference, in MessageOrigin or return; if (typeReference.Scope is AssemblyNameReference) { - var assembly = _context.Resolve (typeReference.Scope); + var assembly = _context.TryResolve (typeReference.Scope); if (assembly != null && _context.TryResolve (typeReference) is TypeDefinition typeDefinition && assembly.MainModule.GetMatchingExportedType (typeDefinition, _context, out var exportedType)) diff --git a/src/tools/illink/src/linker/Linker/ModuleDefinitionExtensions.cs b/src/tools/illink/src/linker/Linker/ModuleDefinitionExtensions.cs index 64ad1df836f6f0..693a3358a60664 100644 --- a/src/tools/illink/src/linker/Linker/ModuleDefinitionExtensions.cs +++ b/src/tools/illink/src/linker/Linker/ModuleDefinitionExtensions.cs @@ -22,7 +22,7 @@ public static bool GetMatchingExportedType (this ModuleDefinition module, TypeDe return false; foreach (var et in module.ExportedTypes) { - if (context.TryResolve (et) == typeDefinition) { + if (context.TryResolve (et, module) == typeDefinition) { exportedType = et; return true; } diff --git a/src/tools/illink/src/linker/Linker/TypeReferenceWalker.cs b/src/tools/illink/src/linker/Linker/TypeReferenceWalker.cs index 7b372891203d5b..00d709454c9cdd 100644 --- a/src/tools/illink/src/linker/Linker/TypeReferenceWalker.cs +++ b/src/tools/illink/src/linker/Linker/TypeReferenceWalker.cs @@ -45,7 +45,7 @@ public virtual void Process () } if (mmodule.HasExportedTypes) - WalkTypeScope (mmodule.ExportedTypes); + WalkTypeScope (mmodule.ExportedTypes, mmodule); ProcessExtra (); } @@ -152,10 +152,10 @@ void WalkTypeScope (Collection parameters) } } - void WalkTypeScope (Collection forwarders) + void WalkTypeScope (Collection forwarders, ModuleDefinition module) { foreach (var f in forwarders) - ProcessExportedType (f); + ProcessExportedType (f, module); } void WalkTypeScope (MethodBody body) @@ -373,7 +373,7 @@ void WalkScopeOfTypeReference (TypeReference type) protected abstract void ProcessTypeReference (TypeReference type); - protected abstract void ProcessExportedType (ExportedType exportedType); + protected abstract void ProcessExportedType (ExportedType exportedType, ModuleDefinition module); } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs index 4d702150ae6f79..f84e1a41318570 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs @@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.Attributes [SetupLinkerTrimMode ("link")] // System.dll referenced by a dynamically (for example in TypeConverterAttribute on IComponent) // has unresolved references. - [SetupLinkerArgument ("--skip-unresolved", "true")] [KeptAttributeInAssembly (PlatformAssemblies.CoreLib, typeof (AssemblyDescriptionAttribute))] [KeptAttributeInAssembly (PlatformAssemblies.CoreLib, typeof (AssemblyCompanyAttribute))] #if !NETCOREAPP diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/IVTUsed.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/IVTUsed.cs index c54b5e222d23a3..f646b7314ad280 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/IVTUsed.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/IVTUsed.cs @@ -13,7 +13,6 @@ namespace Mono.Linker.Tests.Cases.Attributes // This is a bit fragile but it's used to test that ITV attribute is marked correctly [SetupLinkerTrimMode ("link")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [KeptTypeInAssembly (PlatformAssemblies.CoreLib, typeof (InternalsVisibleToAttribute))] class IVTUsed { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnGenericParameterIsRemoved.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnGenericParameterIsRemoved.cs index 09ac559aef5026..91bf2fc45a60d1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnGenericParameterIsRemoved.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnGenericParameterIsRemoved.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed { - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupLinkerArgument ("--used-attrs-only", "true")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyWithUnusedAttributeOnGenericParameter.il" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnReturnTypeIsRemoved.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnReturnTypeIsRemoved.cs index 91a05730a876f1..70a972c9354c77 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnReturnTypeIsRemoved.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeOnReturnTypeIsRemoved.cs @@ -3,8 +3,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed { - [SetupLinkerArgument ("--skip-unresolved", "true")] - [SetupLinkerArgument ("--used-attrs-only", "true")] + [SetupLinkerArgument ("--used-attrs-only", "true")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyWithUnusedAttributeOnReturnParameterDefinition.il" })] [RemovedTypeInAssembly ("library.dll", "Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed.Dependencies.AssemblyWithUnusedAttributeOnReturnParameterDefinition/FooAttribute")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/ComponentModel/CustomTypeConvertor.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/ComponentModel/CustomTypeConvertor.cs index 637b263b68b460..c65974fe6045e4 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/ComponentModel/CustomTypeConvertor.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/ComponentModel/CustomTypeConvertor.cs @@ -57,7 +57,6 @@ public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo [Reference ("System.dll")] // System.dll referenced by a dynamically (for example in TypeConverterAttribute on IComponent) // has unresolved references. - [SetupLinkerArgument ("--skip-unresolved", "true")] public class CustomTypeConvertor { public static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/CoreLink/CopyOfCoreLibrariesKeepsUnusedTypes.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/CoreLink/CopyOfCoreLibrariesKeepsUnusedTypes.cs index 119d34c7acdee5..c340948ed2701a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/CoreLink/CopyOfCoreLibrariesKeepsUnusedTypes.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/CoreLink/CopyOfCoreLibrariesKeepsUnusedTypes.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.CoreLink [SetupLinkerTrimMode ("copy")] // System.dll referenced by a dynamically (for example in TypeConverterAttribute on IComponent) // has unresolved references. - [SetupLinkerArgument ("--skip-unresolved")] [KeptAssembly (PlatformAssemblies.CoreLib)] [KeptAllTypesAndMembersInAssembly (PlatformAssemblies.CoreLib)] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/CppCLIAssemblyIsAnalyzed.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/CppCLIAssemblyIsAnalyzed.cs index 8532b902004d8b..89b845cfecb196 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/CppCLIAssemblyIsAnalyzed.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/CppCLIAssemblyIsAnalyzed.cs @@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.CppCLI { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] [ReferenceDependency ("Dependencies/TestLibrary.dll")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("ManagedSide.dll", new[] { "Dependencies/CallCppCLIFromManagedRef.cs" })] [SetupCompileAfter ("ManagedSide.dll", new[] { "Dependencies/CallCppCLIFromManaged.cs" }, references: new[] { "TestLibrary.dll" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/NonCopyActionWarnOnCppCLI.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/NonCopyActionWarnOnCppCLI.cs index e1edaecb7d3310..c8efeaeb46b1dd 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/NonCopyActionWarnOnCppCLI.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/CppCLI/NonCopyActionWarnOnCppCLI.cs @@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.CppCLI { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] [ReferenceDependency ("Dependencies/TestLibrary.dll")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupLinkerDefaultAction ("copy")] [SetupLinkerAction ("copyused", "TestLibrary")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/UnresolvedMembers.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/UnresolvedMembers.cs index 08658a8e3d8663..eaf74e2ea3f21f 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/UnresolvedMembers.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/UnresolvedMembers.cs @@ -8,6 +8,8 @@ namespace Mono.Linker.Tests.Cases.DataFlow { + [ExpectNonZeroExitCode (1)] + [NoLinkedOutput] [IgnoreTestCase ("Ignore in NativeAOT, see https://github.com/dotnet/runtime/issues/82447", IgnoredBy = Tool.NativeAot)] [KeptAttributeAttribute (typeof (IgnoreTestCaseAttribute), By = Tool.Trimmer)] // NativeAOT will not compile a method with unresolved types in it - it will instead replace it with a throwing method body @@ -15,7 +17,6 @@ namespace Mono.Linker.Tests.Cases.DataFlow // it would fail to JIT/run anyway. [SkipPeVerify] - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("UnresolvedLibrary.dll", new[] { "Dependencies/UnresolvedLibrary.cs" }, removeFromLinkerInput: true)] [ExpectedNoWarnings] class UnresolvedMembers diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethodInAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethodInAssembly.cs index 3baa037798af9c..720d3d2226d3d8 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethodInAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethodInAssembly.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.DynamicDependencies [KeptMemberInAssembly ("library.dll", "Mono.Linker.Tests.Cases.DynamicDependencies.Dependencies.DynamicDependencyMethodInAssemblyLibrary", ".ctor()")] [KeptMemberInAssembly ("library.dll", "Mono.Linker.Tests.Cases.DynamicDependencies.Dependencies.DynamicDependencyMethodInAssemblyLibrary", "privateField")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/DynamicDependencyMethodInAssemblyLibrary.cs" })] - [SetupLinkerArgument ("--skip-unresolved", "true")] public class DynamicDependencyMethodInAssembly { public static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/DefaultInterfaceMethods/InterfaceWithAttributeOnImplementation.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/DefaultInterfaceMethods/InterfaceWithAttributeOnImplementation.cs index cc0dbb3756fcd4..f9a10e65f7ca6d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/DefaultInterfaceMethods/InterfaceWithAttributeOnImplementation.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/DefaultInterfaceMethods/InterfaceWithAttributeOnImplementation.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.DefaultInterfaceMethods { - [SetupLinkerArgument ("--skip-unresolved", "true")] [TestCaseRequirements (TestRunCharacteristics.SupportsDefaultInterfaceMethods, "Requires support for default interface methods")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/InterfaceWithAttributeOnImpl.il" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndAssemblyPreserveAll.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndAssemblyPreserveAll.cs index 6f8013d9a27847..4925e2fa9f1e30 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndAssemblyPreserveAll.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndAssemblyPreserveAll.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] [KeptInterfaceOnTypeInAssemblyAttribute ("library", diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveAll.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveAll.cs index b7acf5c8fc05f1..8ebde9a080b34c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveAll.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveAll.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] [KeptInterfaceOnTypeInAssembly ("library", "Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor.Dependencies.NoInstanceCtorAndAssemblyPreserveAll_Lib/A", diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFields.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFields.cs index 0b202c3e6df5a0..fd95a4fe7899b6 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFields.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFields.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] // The interfaces should be removed because the interface types are not marked diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFieldsWithInterfacesMarked.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFieldsWithInterfacesMarked.cs index 87ba0dafd88140..994f275495eea0 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFieldsWithInterfacesMarked.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveFieldsWithInterfacesMarked.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("IL_ASSEMBLY_COMPILED")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethods.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethods.cs index 4173959d4cd715..88d183c1057a18 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethods.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethods.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] // The interfaces should be removed because the interface types are not marked diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethodsWithInterfacesMarked.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethodsWithInterfacesMarked.cs index feeff9fd36619c..7488488e6d9e6d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethodsWithInterfacesMarked.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveMethodsWithInterfacesMarked.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("IL_ASSEMBLY_COMPILED")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveNone.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveNone.cs index 0f792df4d39bb0..0a433ae26fa0d0 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveNone.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoInstanceCtor/NoInstanceCtorAndTypePreserveNone.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor { - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/NoInstanceCtorAndAssemblyPreserveAll_Lib.il" })] [RemovedInterfaceOnTypeInAssembly ("library", "Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoInstanceCtor.Dependencies.NoInstanceCtorAndAssemblyPreserveAll_Lib/A", diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Libraries/LibraryWithUnresolvedInterfaces.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Libraries/LibraryWithUnresolvedInterfaces.cs index d7f015495350f1..0ea160df5e277f 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Libraries/LibraryWithUnresolvedInterfaces.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Libraries/LibraryWithUnresolvedInterfaces.cs @@ -7,8 +7,9 @@ namespace Mono.Linker.Tests.Cases.Libraries { + [ExpectNonZeroExitCode (1)] + [NoLinkedOutput] [SetupCompileBefore ("copylibrary.dll", new[] { "Dependencies/CopyLibrary.cs" }, removeFromLinkerInput: true)] - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupLinkerArgument ("-a", "test.exe", "library")] [SetupLinkerArgument ("--enable-opt", "ipconstprop")] [VerifyMetadataNames] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkAttributeErrorCases.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkAttributeErrorCases.cs index 91938c375f96da..92f0d28405225f 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkAttributeErrorCases.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkAttributeErrorCases.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.LinkAttributes { [SetupLinkAttributesFile ("LinkAttributeErrorCases.xml")] [IgnoreLinkAttributes (false)] - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileBefore ("library.dll", new string[] { "Dependencies/EmbeddedAttributeErrorCases.cs" }, resources: new object[] { new string[] { "Dependencies/EmbeddedAttributeErrorCases.xml", "ILLink.LinkAttributes.xml" } })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkXml/LinkXmlErrorCases.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkXml/LinkXmlErrorCases.cs index 074216595ed306..e37fa5f18b9edd 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkXml/LinkXmlErrorCases.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkXml/LinkXmlErrorCases.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.LinkXml { [SetupLinkerDescriptorFile ("LinkXmlErrorCases.xml")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [ExpectedWarning ("IL2001", "TypeWithNoFields", FileName = "LinkXmlErrorCases.xml", SourceLine = 3, SourceColumn = 6)] [ExpectedWarning ("IL2002", "TypeWithNoMethods", FileName = "LinkXmlErrorCases.xml", SourceLine = 4, SourceColumn = 6)] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/PreserveDependencies/PreserveDependencyErrorCases.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/PreserveDependencies/PreserveDependencyErrorCases.cs index ffad45b3a42d40..d5cb35d0d827b9 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/PreserveDependencies/PreserveDependencyErrorCases.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/PreserveDependencies/PreserveDependencyErrorCases.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.PreserveDependencies { [SetupCompileBefore ("FakeSystemAssembly.dll", new[] { "Dependencies/PreserveDependencyAttribute.cs" })] - [SetupLinkerArgument ("--skip-unresolved", "true")] class PreserveDependencyErrorCases { public static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/References/Individual/CanSkipUnresolved.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/References/Individual/CanSkipUnresolved.cs index 47b51b326175e0..bcf53578a26148 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/References/Individual/CanSkipUnresolved.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/References/Individual/CanSkipUnresolved.cs @@ -1,11 +1,13 @@ -using Mono.Linker.Tests.Cases.Expectations.Metadata; +using Mono.Linker.Tests.Cases.Expectations.Assertions; +using Mono.Linker.Tests.Cases.Expectations.Metadata; using Mono.Linker.Tests.Cases.References.Individual.Dependencies; namespace Mono.Linker.Tests.Cases.References.Individual { + [ExpectNonZeroExitCode (1)] + [NoLinkedOutput] [SetupCompileBefore ("library1.dll", new[] { "Dependencies/CanSkipUnresolved_Library.cs" })] [SetupCompileAfter ("library1.dll", new[] { "Dependencies/CanSkipUnresolved_Library.cs" }, defines: new[] { "EXCLUDE_STUFF" })] - [SetupLinkerArgument ("--skip-unresolved", "true")] public class CanSkipUnresolved { static void Main () diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdb.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdb.cs index 20d7644cfac57b..252399682d5119 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdb.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdb.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] [SetupLinkerLinkSymbols ("false")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbCopyAction.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbCopyAction.cs index 2807649f9e5fc0..3c47a8cabc3119 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbCopyAction.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbCopyAction.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] [SetupLinkerLinkSymbols ("false")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteAction.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteAction.cs index 4a0009ec5c06e7..3ea8ce4f1df1bf 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteAction.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteAction.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] [SetupLinkerLinkSymbols ("false")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteActionAndSymbolLinkingEnabled.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteActionAndSymbolLinkingEnabled.cs index 940b4ab4692d04..d599b6f93e7245 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteActionAndSymbolLinkingEnabled.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbDeleteActionAndSymbolLinkingEnabled.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] [SetupLinkerLinkSymbols ("true")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdb.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdb.cs index 6daed1d3cae00b..5fb492e1511ac9 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdb.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdb.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("false")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabled.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabled.cs index 30e08568cf4610..c5d54d3870a331 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabled.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabled.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("true")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndDeterministicMvid.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndDeterministicMvid.cs index c0c9ebbb120362..1a8b00c2e14609 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndDeterministicMvid.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndDeterministicMvid.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("true")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndNewMvid.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndNewMvid.cs index 7fa906085873d8..ae7c8681618455 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndNewMvid.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndNewMvid.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("true")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbCopyAction.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbCopyAction.cs index 95b12c7461c55a..b8453304f4293e 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbCopyAction.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbCopyAction.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("false")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteAction.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteAction.cs index 6a759af760f83d..2443dcef833028 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteAction.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteAction.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("false")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteActionAndSymbolLinkingEnabled.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteActionAndSymbolLinkingEnabled.cs index ba1ae6eae7bd7c..f40ee1e70827b4 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteActionAndSymbolLinkingEnabled.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbDeleteActionAndSymbolLinkingEnabled.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] [SetupLinkerLinkSymbols ("true")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypes.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypes.cs index 9a111d16cd9bcf..f27e0f866e9b10 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypes.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypes.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesAndSymbolLinkingEnabled.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesAndSymbolLinkingEnabled.cs index bcb35f5e93d92b..1fd2372fdb385a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesAndSymbolLinkingEnabled.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesAndSymbolLinkingEnabled.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesWithMdbAndSymbolLinkingEnabled.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesWithMdbAndSymbolLinkingEnabled.cs index 7ab84855a7f2cb..afa903cd766a36 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesWithMdbAndSymbolLinkingEnabled.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Symbols/ReferencesWithMixedSymbolTypesWithMdbAndSymbolLinkingEnabled.cs @@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.Symbols { [IgnoreTestCase ("Test relies on checked-in binaries: https://github.com/dotnet/runtime/issues/78344")] [TestCaseRequirements (TestRunCharacteristics.TargetingNetFramework, "mdb files are not supported with .NET Core")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] [ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/TestFramework/CanCompileILAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/TestFramework/CanCompileILAssembly.cs index ec235b851b08a0..a0032892504036 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/TestFramework/CanCompileILAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/TestFramework/CanCompileILAssembly.cs @@ -4,7 +4,6 @@ namespace Mono.Linker.Tests.Cases.TestFramework { - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupCompileBefore ("ILAssembly.dll", new[] { "Dependencies/ILAssemblySample.il" })] [KeptMemberInAssembly ("ILAssembly.dll", "Mono.Linker.Tests.Cases.TestFramework.Dependencies.ILAssemblySample", "GiveMeAValue()")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs index 96d49426cf6388..a104b906ad19c2 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs @@ -12,7 +12,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding /// /// In order words, until https://github.com/dotnet/linker/issues/1703 is addressed this test will pass with or without the fix to update the scope on security attributes /// - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupLinkerArgument ("--strip-security", "false")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupLinkerAction ("copy", "Library")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs index 2eaeaed07d9d8a..513605895113ec 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs @@ -3,6 +3,8 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { + [ExpectNonZeroExitCode (1)] + [NoLinkedOutput] [SkipUnresolved (true)] [SetupCompileBefore ("Lib.dll", new[] { "Dependencies/TypeForwardedIsUpdatedForMissingTypeLib.cs" })] [SetupCompileBefore ("AnotherLibrary.dll", new[] { "Dependencies/TypeForwardedIsUpdatedForMissingTypeLib2.cs" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs index 55689eb490c784..12728742f98c75 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { - [SetupLinkerArgument ("--skip-unresolved", "true")] // Actions: // link - This assembly, TypeForwarderModifiersLibDef.dll and TypeForwardersModifiersLib.dll [SetupLinkerDefaultAction ("link")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs index 240f365439954a..e28fde184d16b2 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // Actions: // link - This assembly, Forwarder.dll and Implementation.dll - [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupCompileArgument ("/unsafe")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/TypeForwardersRewriteLib.cs" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/EndScopeOnMethoEnd.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/EndScopeOnMethoEnd.cs index 7090d85ecaf99c..85b9636a018726 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/EndScopeOnMethoEnd.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/EndScopeOnMethoEnd.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/EndScopeOnMethod.il" })] public class EndScopeOnMethoEnd diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/UninitializedLocals.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/UninitializedLocals.cs index d0404ce3ca4cb9..be5b3c83208c78 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/UninitializedLocals.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/UninitializedLocals.cs @@ -5,7 +5,6 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { [SetupCSharpCompilerToUse ("csc")] [SetupCompileArgument ("/optimize+")] - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("IL_ASSEMBLY_AVAILABLE")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/LocalsWithoutStore.il" })] [SetupLinkerArgument ("--enable-opt", "ipconstprop")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/DoesNotApplyToCopiedAssembly2.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/DoesNotApplyToCopiedAssembly2.cs index ce699e22904392..29353e642b313a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/DoesNotApplyToCopiedAssembly2.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/DoesNotApplyToCopiedAssembly2.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.UnreachableBody { - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("OTHER_INCLUDED")] [SetupLinkerAction ("copy", "other")] [SetupCompileBefore ("other.dll", new[] { "Dependencies/OtherAssemblyNoInstanceCtor.il" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs index 852c9351af12bc..0273382b620810 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs @@ -3,7 +3,6 @@ namespace Mono.Linker.Tests.Cases.UnreachableBody { - [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("OTHER_INCLUDED")] #if NETCOREAPP [SetupLinkerArgument ("-a", "other.dll", "visible")] diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCases/IndividualTests.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCases/IndividualTests.cs index 7fa976b55c5842..5991c4404466e1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCases/IndividualTests.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCases/IndividualTests.cs @@ -33,8 +33,10 @@ public void CanSkipUnresolved () // We can't use the ResultChecker on the output because there will be unresolved types/methods // Let's just make sure that the output assembly exists. That's enough to verify that ILLink didn't throw due to the // missing types/methods - if (!result.OutputAssemblyPath.Exists ()) - Assert.Fail ($"The linked assembly is missing. Should have existed at {result.OutputAssemblyPath}"); + if (result.OutputAssemblyPath.Exists ()) + Assert.Fail ($"The linked assembly is present at {result.OutputAssemblyPath}. Should not have been produced."); + if (result.ExitCode != 1) + Assert.Fail ($"The linker returned exit code {result.ExitCode}. Should have returned 1."); } [Test] 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 3164478220714c..9b39171e2d98e5 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs @@ -113,14 +113,6 @@ public virtual void AddAssemblyAction (string action, string assembly) Append (assembly); } - public virtual void AddSkipUnresolved (bool skipUnresolved) - { - if (skipUnresolved) { - Append ("--skip-unresolved"); - Append ("true"); - } - } - public virtual void AddStripDescriptors (bool stripDescriptors) { if (!stripDescriptors) { @@ -213,8 +205,6 @@ public virtual void ProcessOptions (TestCaseLinkerOptions options) if (!string.IsNullOrEmpty (options.LinkSymbols)) AddLinkSymbols (options.LinkSymbols); - AddSkipUnresolved (options.SkipUnresolved); - AddStripDescriptors (options.StripDescriptors); AddStripSubstitutions (options.StripSubstitutions);