diff --git a/src/System.Runtime/ref/System.Runtime.cs b/src/System.Runtime/ref/System.Runtime.cs index acbcff4f00e8..ccec81ac77fe 100644 --- a/src/System.Runtime/ref/System.Runtime.cs +++ b/src/System.Runtime/ref/System.Runtime.cs @@ -6661,6 +6661,7 @@ public MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions met public enum MethodImplOptions { AggressiveInlining = 256, + AggressiveOptimization = 512, ForwardRef = 16, InternalCall = 4096, NoInlining = 8, diff --git a/src/System.Runtime/tests/System/Runtime/CompilerServices/MethodImplAttributeTests.cs b/src/System.Runtime/tests/System/Runtime/CompilerServices/MethodImplAttributeTests.cs new file mode 100644 index 000000000000..1cca47ec35b4 --- /dev/null +++ b/src/System.Runtime/tests/System/Runtime/CompilerServices/MethodImplAttributeTests.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Reflection; +using Xunit; + +namespace System.Runtime.CompilerServices.Tests +{ + public static class MethodImplAttributeTests + { + [Fact] + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public static void AggressiveOptimizationTest() + { + Assert.Equal( + MethodImplOptions.AggressiveOptimization, + MethodBase.GetCurrentMethod().GetCustomAttribute().Value); + } + } +}