forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure DecomposeRotate correctly orders parameters. (dotnet#86066)
* Add a regression test for dotnet#86207 * Ensure RotateRight and RotateLeft decomposition orders parameters correctly * Add explicit tests covering the other two DecomposeRotate paths * Ensure other code paths that create GT_RSH_LO nodes aren't broken
- Loading branch information
1 parent
d4175a8
commit c13325f
Showing
4 changed files
with
112 additions
and
6 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
87 changes: 87 additions & 0 deletions
87
src/tests/JIT/Regression/JitBlue/Runtime_86027/Runtime_86207.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,87 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using Xunit; | ||
|
||
public class Runtime_86027 | ||
{ | ||
[Fact] | ||
public static int TestRotateLeft1() | ||
{ | ||
long[] firstOp = new long[] { 7822136809956075968, 1 }; | ||
|
||
if (long.RotateLeft(firstOp[0], 1) != -2802470453797399680) | ||
{ | ||
return 0; | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
[Fact] | ||
public static int TestRotateLeft32() | ||
{ | ||
long[] firstOp = new long[] { 7822136809956075968, 1 }; | ||
|
||
if (long.RotateLeft(firstOp[0], 32) != 3886722753596608508) | ||
{ | ||
return 0; | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
[Fact] | ||
public static int TestRotateLeft33() | ||
{ | ||
long[] firstOp = new long[] { 7822136809956075968, 1 }; | ||
|
||
if (long.RotateLeft(firstOp[0], 33) != 7773445507193217016) | ||
{ | ||
return 0; | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
[Fact] | ||
public static int TestRotateRight1() | ||
{ | ||
long[] firstOp = new long[] { 7822136809956075968, 1 }; | ||
|
||
if (long.RotateRight(firstOp[0], 1) != 3911068404978037984) | ||
{ | ||
return 0; | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
[Fact] | ||
public static int TestRotateRight32() | ||
{ | ||
long[] firstOp = new long[] { 7822136809956075968, 1 }; | ||
|
||
if (long.RotateRight(firstOp[0], 32) != 3886722753596608508) | ||
{ | ||
return 0; | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
[Fact] | ||
public static int TestRotateRight33() | ||
{ | ||
long[] firstOp = new long[] { 7822136809956075968, 1 }; | ||
|
||
if (long.RotateRight(firstOp[0], 33) != 1943361376798304254) | ||
{ | ||
return 0; | ||
} | ||
|
||
return 100; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_86027/Runtime_86207.csproj
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,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |