[runtime] Emit the necessary left shift anding in the LambdaCompiler
authorAlexander Kyte <alexmkyte@gmail.com>
Mon, 1 Jun 2015 18:14:00 +0000 (18:14 +0000)
committerAlexander Kyte <alexmkyte@gmail.com>
Tue, 2 Jun 2015 19:31:00 +0000 (19:31 +0000)
commitc5d5da257e9ba9ed3a4cd3191b8165065933b115
tree057ad28b75132bd4d3e85b8031f55c85de52f5b0
parent8b7564815190fa35178a7c2305fc0e44c87add95
[runtime] Emit the necessary left shift anding in the LambdaCompiler

We were observing dtest-006.exe test failing on armhf. This test
checks that a right shift with a negative shift amount and a
dynamic base is shifted by the right amount.

We were failing it because we were excluding the step that we
do in regular code generation, which is to do a binary and of the shift
amount so it behaves like we are shifting by the original shift
amount modulo 32. The C# spec defines left shift like so.

This commit adds that to the LambdaCompiler.
mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs
mcs/tests/dtest-061.cs [new file with mode: 0644]