summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/rsh-sanity-1.js
blob: 3127a32ab8823e9bbe66ce982fa7234a178c03f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Unknown types. */
function rsh(lhs, rhs) { return lhs >> rhs; }
assertEq(rsh(1024, 2), 256)
assertEq(rsh(1024.5, 2), 256)
assertEq(rsh(1024.5, 2.0), 256)

/* Constant rhs. */
var lhs = 1024;
assertEq(lhs >> 2, 256);
lhs = 1024.5;
assertEq(lhs >> 2, 256);

/* Constant lhs. */
var rhs = 2;
assertEq(256, 1024 >> rhs);
var rhs = 2.0;
assertEq(256, 1024 >> rhs);