diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeInPreservedAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeInPreservedAssembly.cs index 83ae5834cdc96..ef3e609907a05 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeInPreservedAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeInPreservedAssembly.cs @@ -17,6 +17,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow [ExpectedNoWarnings] [SetupLinkerArgument ("--enable-opt", "ipconstprop")] [SetupLinkerDescriptorFile ("CompilerGeneratedCodeInPreservedAssembly.xml")] + [SetupLinkerArgument ("--feature", "AlwaysFalse", "false")] class CompilerGeneratedCodeInPreservedAssembly { public static void Main () @@ -40,9 +41,7 @@ public static void WithLocalFunctionInner () } // Analyzer doesn't implement constant propagation and branch removal, so it reaches this code - // NativeAOT behavioral difference: - // https://github.com/dotnet/runtime/issues/85161 - [ExpectedWarning ("IL2026", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2026", Tool.Analyzer, "")] void LocalWithWarning () { // No warning @@ -62,15 +61,14 @@ public static void WithLocalFunction () } // Analyzer doesn't implement constant propagation and branch removal, so it reaches this code - // NativeAOT behavioral difference: - // https://github.com/dotnet/runtime/issues/85161 - [ExpectedWarning ("IL2026", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2026", Tool.Analyzer, "")] void LocalWithWarning () { Requires (); } } + [FeatureSwitchDefinition ("AlwaysFalse")] public static bool AlwaysFalse => false; [RequiresUnreferencedCode ("RUC")]