Skip to content

Commit

Permalink
Expose MethodImplOptions.AggressiveOptimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kouvel committed Oct 4, 2018
1 parent 7cddd8e commit 0a79ccc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6634,6 +6634,7 @@ public MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions met
public enum MethodImplOptions
{
AggressiveInlining = 256,
AggressiveOptimization = 512,
ForwardRef = 16,
InternalCall = 4096,
NoInlining = 8,
Expand Down
Original file line number Diff line number Diff line change
@@ -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<MethodImplAttribute>().Value);
}
}
}

0 comments on commit 0a79ccc

Please sign in to comment.