This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose MethodImplOptions.AggressiveOptimization and MethodImplAttribu…
…tes.AggressiveOptimization (#32322) * Expose MethodImplOptions.AggressiveOptimization Part of fix for https://github.com/dotnet/corefx/issues/32235 Depends on dotnet/coreclr#20009 API review: https://github.com/dotnet/corefx/issues/32235 * Include new test * Expose MethodImplAttributes.AggressiveOptimization and fix test API review: https://github.com/dotnet/corefx/issues/32628
- Loading branch information
1 parent
7a75bbf
commit 3f0a1ee
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...stem.Runtime/tests/System/Runtime/CompilerServices/MethodImplAttributeTests.netcoreapp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
{ | ||
MethodImplAttributes implAttributes = MethodBase.GetCurrentMethod().MethodImplementationFlags; | ||
Assert.Equal(MethodImplAttributes.AggressiveOptimization, implAttributes); | ||
Assert.Equal(MethodImplOptions.AggressiveOptimization, (MethodImplOptions)implAttributes); | ||
} | ||
} | ||
} |