summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2015-11-16 15:47:59 -0800
committerEugene Rozenfeld <erozen@microsoft.com>2015-11-16 15:47:59 -0800
commit8284a530a90e921598479930c6fc1b9a0625b918 (patch)
tree1df8d6686a4438f12c6f47b93101a0cda381dccc /tests/src
parent6a5862d9ff02af846fd25e216ff7948ecb7c49cc (diff)
downloadcoreclr-8284a530a90e921598479930c6fc1b9a0625b918.tar.gz
coreclr-8284a530a90e921598479930c6fc1b9a0625b918.tar.bz2
coreclr-8284a530a90e921598479930c6fc1b9a0625b918.zip
Fix for a rotation transformation bug.
rotatedValueBitSize should be calculated from genActualType(rotatedValue->gtType) instead of rotatedValue->gtType. I added a test that was failing with an assert because of this bug: rol32ushort.
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/JIT/CodeGenBringUpTests/Rotate.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/src/JIT/CodeGenBringUpTests/Rotate.cs b/tests/src/JIT/CodeGenBringUpTests/Rotate.cs
index 936718ce50..f5c2c04d15 100644
--- a/tests/src/JIT/CodeGenBringUpTests/Rotate.cs
+++ b/tests/src/JIT/CodeGenBringUpTests/Rotate.cs
@@ -14,6 +14,8 @@ public class Test
volatile uint volatile_field;
+ ushort usfield;
+
[MethodImpl(MethodImplOptions.NoInlining)]
static uint rol32(uint value, int amount)
{
@@ -166,10 +168,17 @@ public class Test
return (value >> 10) | (value << 5);
}
- Test(ulong i, uint j)
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ uint rol32ushort(int amount)
+ {
+ return ((uint)usfield << amount) | ((uint)usfield >> (32 - amount));
+ }
+
+ Test(ulong i, uint j, ushort k)
{
field = i;
volatile_field = j;
+ usfield = k;
}
public static int Main()
@@ -291,6 +300,11 @@ public class Test
return Fail;
}
+ if (test.rol32ushort(25) != 0x68000024)
+ {
+ return Fail;
+ }
+
return Pass;
}
}