diff options
author | Mike Voorhees <mrvoorhe@users.noreply.github.com> | 2020-03-02 17:41:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 17:41:08 +0300 |
commit | 3ab050a1bab04b84e8544b32e2ff6da446b4a79a (patch) | |
tree | a45a7907748dc8c3a551f5d84b9de1697d25fe2a /test/Mono.Linker.Tests.Cases | |
parent | cd01694ab1406159dd8e3f0ab81624f5feec2414 (diff) |
Explicitly enable optimization during test (#974)
Explicitly enable `IPConstantPropagation` during the `UnreachableBlock` tests. This gives implementors of a linker executable the freedom to pick which optimizations are enabled by default while also ensuring that they can pass all tests.
This is consistent with other optimizations such as unreachable bodies, used attrs only, etc.
Diffstat (limited to 'test/Mono.Linker.Tests.Cases')
8 files changed, 9 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/BodiesWithSubstitutions.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/BodiesWithSubstitutions.cs index 1e3839286..2994fe267 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/BodiesWithSubstitutions.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/BodiesWithSubstitutions.cs @@ -6,6 +6,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock [SetupLinkerSubstitutionFile ("BodiesWithSubstitutions.xml")] [SetupCSharpCompilerToUse ("csc")] [SetupCompileArgument ("/optimize+")] + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class BodiesWithSubstitutions { static class ClassWithField diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs index 2660b240d..e2d19f75f 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs @@ -6,6 +6,7 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.UnreachableBlock { [SetupCompileArgument ("/optimize-")] // Relying on debug csc behaviour + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class ComplexConditions { public static void Main () diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/DeadVariables.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/DeadVariables.cs index 58c960936..b779c571f 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/DeadVariables.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/DeadVariables.cs @@ -6,6 +6,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { [SetupCSharpCompilerToUse ("csc")] [SetupCompileArgument ("/optimize+")] + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class DeadVariables { public static void Main () diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/MultiStageRemoval.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/MultiStageRemoval.cs index b4acde444..a28ac1929 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/MultiStageRemoval.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/MultiStageRemoval.cs @@ -5,6 +5,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { [SetupCSharpCompilerToUse ("csc")] [SetupCompileArgument ("/optimize+")] + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class MultiStageRemoval { public static void Main() diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/ReplacedReturns.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/ReplacedReturns.cs index 35274f11f..e44bd9856 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/ReplacedReturns.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/ReplacedReturns.cs @@ -6,6 +6,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { [SetupCSharpCompilerToUse ("csc")] [SetupCompileArgument ("/optimize+")] + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class ReplacedReturns { public static void Main () diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/SimpleConditionalProperty.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/SimpleConditionalProperty.cs index 1b0eaad0d..92c8b650a 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/SimpleConditionalProperty.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/SimpleConditionalProperty.cs @@ -6,6 +6,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { // [SetupCSharpCompilerToUse ("csc")] [SetupCompileArgument ("/optimize+")] + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class SimpleConditionalProperty { public static void Main() diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs index 5bc7bbe90..c8db2bb4f 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs @@ -9,6 +9,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { [SetupLinkerSubstitutionFile ("SizeOfInConditions.net_4_x.xml")] #endif [SetupCompileArgument ("/unsafe")] + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public unsafe class SizeOfInConditions { public static void Main () { diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/TryFinallyBlocks.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/TryFinallyBlocks.cs index defc213d4..8ab023599 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/TryFinallyBlocks.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/TryFinallyBlocks.cs @@ -1,7 +1,9 @@ using Mono.Linker.Tests.Cases.Expectations.Assertions; +using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.UnreachableBlock { + [SetupLinkerArgument ("--enable-opt", "ipconstantpropagation")] public class TryFinallyBlocks { public static void Main () |