summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testBitopWithConstan.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/jit-test/tests/basic/testBitopWithConstan.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit-test/tests/basic/testBitopWithConstan.js')
-rw-r--r--js/src/jit-test/tests/basic/testBitopWithConstan.js741
1 files changed, 741 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testBitopWithConstan.js b/js/src/jit-test/tests/basic/testBitopWithConstan.js
new file mode 100644
index 000000000..494994d7f
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testBitopWithConstan.js
@@ -0,0 +1,741 @@
+function test1 (x) {
+ assertEq(x | -1, -1);
+ assertEq(-1 | x, -1);
+ assertEq(x & -1, 1);
+ assertEq(-1 & x, 1);
+ assertEq(x ^ -1, -2);
+ assertEq(-1 ^ x, -2);
+ assertEq(x >> -1, 0);
+ assertEq(-1 >> x, -1);
+ assertEq(x >>> -1, 0);
+ assertEq(-1 >>> x, 2147483647);
+ assertEq(x << -1, -2147483648);
+ assertEq(-1 << x, -2);
+ assertEq(x | 1, 1);
+ assertEq(1 | x, 1);
+ assertEq(x & 1, 1);
+ assertEq(1 & x, 1);
+ assertEq(x ^ 1, 0);
+ assertEq(1 ^ x, 0);
+ assertEq(x >> 1, 0);
+ assertEq(1 >> x, 0);
+ assertEq(x >>> 1, 0);
+ assertEq(1 >>> x, 0);
+ assertEq(x << 1, 2);
+ assertEq(1 << x, 2);
+ assertEq(x | 0, 1);
+ assertEq(0 | x, 1);
+ assertEq(x & 0, 0);
+ assertEq(0 & x, 0);
+ assertEq(x ^ 0, 1);
+ assertEq(0 ^ x, 1);
+ assertEq(x >> 0, 1);
+ assertEq(0 >> x, 0);
+ assertEq(x >>> 0, 1);
+ assertEq(0 >>> x, 0);
+ assertEq(x << 0, 1);
+ assertEq(0 << x, 0);
+ assertEq(x | 0xffffffff, -1);
+ assertEq(0xffffffff | x, -1);
+ assertEq(x & 0xffffffff, 1);
+ assertEq(0xffffffff & x, 1);
+ assertEq(x ^ 0xffffffff, -2);
+ assertEq(0xffffffff ^ x, -2);
+ assertEq(x >> 0xffffffff, 0);
+ assertEq(0xffffffff >> x, -1);
+ assertEq(x >>> 0xffffffff, 0);
+ assertEq(0xffffffff >>> x, 2147483647);
+ assertEq(x << 0xffffffff, -2147483648);
+ assertEq(0xffffffff << x, -2);
+ assertEq(x | "10.6", 11);
+ assertEq("10.6" | x, 11);
+ assertEq(x & "10.6", 0);
+ assertEq("10.6" & x, 0);
+ assertEq(x ^ "10.6", 11);
+ assertEq("10.6" ^ x, 11);
+ assertEq(x >> "10.6", 0);
+ assertEq("10.6" >> x, 5);
+ assertEq(x >>> "10.6", 0);
+ assertEq("10.6" >>> x, 5);
+ assertEq(x << "10.6", 1024);
+ assertEq("10.6" << x, 20);
+ assertEq(x | 2147483648, -2147483647);
+ assertEq(2147483648 | x, -2147483647);
+ assertEq(x & 2147483648, 0);
+ assertEq(2147483648 & x, 0);
+ assertEq(x ^ 2147483648, -2147483647);
+ assertEq(2147483648 ^ x, -2147483647);
+ assertEq(x >> 2147483648, 1);
+ assertEq(2147483648 >> x, -1073741824);
+ assertEq(x >>> 2147483648, 1);
+ assertEq(2147483648 >>> x, 1073741824);
+ assertEq(x << 2147483648, 1);
+ assertEq(2147483648 << x, 0);
+ assertEq(x | 4294967296, 1);
+ assertEq(4294967296 | x, 1);
+ assertEq(x & 4294967296, 0);
+ assertEq(4294967296 & x, 0);
+ assertEq(x ^ 4294967296, 1);
+ assertEq(4294967296 ^ x, 1);
+ assertEq(x >> 4294967296, 1);
+ assertEq(4294967296 >> x, 0);
+ assertEq(x >>> 4294967296, 1);
+ assertEq(4294967296 >>> x, 0);
+ assertEq(x << 4294967296, 1);
+ assertEq(4294967296 << x, 0);
+ assertEq(x | undefined, 1);
+ assertEq(undefined | x, 1);
+ assertEq(x & undefined, 0);
+ assertEq(undefined & x, 0);
+ assertEq(x ^ undefined, 1);
+ assertEq(undefined ^ x, 1);
+ assertEq(x >> undefined, 1);
+ assertEq(undefined >> x, 0);
+ assertEq(x >>> undefined, 1);
+ assertEq(undefined >>> x, 0);
+ assertEq(x << undefined, 1);
+ assertEq(undefined << x, 0);
+ assertEq(x | null, 1);
+ assertEq(null | x, 1);
+ assertEq(x & null, 0);
+ assertEq(null & x, 0);
+ assertEq(x ^ null, 1);
+ assertEq(null ^ x, 1);
+ assertEq(x >> null, 1);
+ assertEq(null >> x, 0);
+ assertEq(x >>> null, 1);
+ assertEq(null >>> x, 0);
+ assertEq(x << null, 1);
+ assertEq(null << x, 0);
+ assertEq(x | false, 1);
+ assertEq(false | x, 1);
+ assertEq(x & false, 0);
+ assertEq(false & x, 0);
+ assertEq(x ^ false, 1);
+ assertEq(false ^ x, 1);
+ assertEq(x >> false, 1);
+ assertEq(false >> x, 0);
+ assertEq(x >>> false, 1);
+ assertEq(false >>> x, 0);
+ assertEq(x << false, 1);
+ assertEq(false << x, 0);
+ assertEq(x | true, 1);
+ assertEq(true | x, 1);
+ assertEq(x & true, 1);
+ assertEq(true & x, 1);
+ assertEq(x ^ true, 0);
+ assertEq(true ^ x, 0);
+ assertEq(x >> true, 0);
+ assertEq(true >> x, 0);
+ assertEq(x >>> true, 0);
+ assertEq(true >>> x, 0);
+ assertEq(x << true, 2);
+ assertEq(true << x, 2);
+ assertEq(x | -1.5, -1);
+ assertEq(-1.5 | x, -1);
+ assertEq(x & -1.5, 1);
+ assertEq(-1.5 & x, 1);
+ assertEq(x ^ -1.5, -2);
+ assertEq(-1.5 ^ x, -2);
+ assertEq(x >> -1.5, 0);
+ assertEq(-1.5 >> x, -1);
+ assertEq(x >>> -1.5, 0);
+ assertEq(-1.5 >>> x, 2147483647);
+ assertEq(x << -1.5, -2147483648);
+ assertEq(-1.5 << x, -2);
+}
+test1(1)
+
+function test2 (x) {
+ assertEq(x | -1, -1);
+ assertEq(-1 | x, -1);
+ assertEq(x & -1, 0);
+ assertEq(-1 & x, 0);
+ assertEq(x ^ -1, -1);
+ assertEq(-1 ^ x, -1);
+ assertEq(x >> -1, 0);
+ assertEq(-1 >> x, -1);
+ assertEq(x >>> -1, 0);
+ assertEq(-1 >>> x, 4294967295);
+ assertEq(x << -1, 0);
+ assertEq(-1 << x, -1);
+ assertEq(x | 1, 1);
+ assertEq(1 | x, 1);
+ assertEq(x & 1, 0);
+ assertEq(1 & x, 0);
+ assertEq(x ^ 1, 1);
+ assertEq(1 ^ x, 1);
+ assertEq(x >> 1, 0);
+ assertEq(1 >> x, 1);
+ assertEq(x >>> 1, 0);
+ assertEq(1 >>> x, 1);
+ assertEq(x << 1, 0);
+ assertEq(1 << x, 1);
+ assertEq(x | 0, 0);
+ assertEq(0 | x, 0);
+ assertEq(x & 0, 0);
+ assertEq(0 & x, 0);
+ assertEq(x ^ 0, 0);
+ assertEq(0 ^ x, 0);
+ assertEq(x >> 0, 0);
+ assertEq(0 >> x, 0);
+ assertEq(x >>> 0, 0);
+ assertEq(0 >>> x, 0);
+ assertEq(x << 0, 0);
+ assertEq(0 << x, 0);
+ assertEq(x | 0xffffffff, -1);
+ assertEq(0xffffffff | x, -1);
+ assertEq(x & 0xffffffff, 0);
+ assertEq(0xffffffff & x, 0);
+ assertEq(x ^ 0xffffffff, -1);
+ assertEq(0xffffffff ^ x, -1);
+ assertEq(x >> 0xffffffff, 0);
+ assertEq(0xffffffff >> x, -1);
+ assertEq(x >>> 0xffffffff, 0);
+ assertEq(0xffffffff >>> x, 4294967295);
+ assertEq(x << 0xffffffff, 0);
+ assertEq(0xffffffff << x, -1);
+ assertEq(x | "10.6", 10);
+ assertEq("10.6" | x, 10);
+ assertEq(x & "10.6", 0);
+ assertEq("10.6" & x, 0);
+ assertEq(x ^ "10.6", 10);
+ assertEq("10.6" ^ x, 10);
+ assertEq(x >> "10.6", 0);
+ assertEq("10.6" >> x, 10);
+ assertEq(x >>> "10.6", 0);
+ assertEq("10.6" >>> x, 10);
+ assertEq(x << "10.6", 0);
+ assertEq("10.6" << x, 10);
+ assertEq(x | 2147483648, -2147483648);
+ assertEq(2147483648 | x, -2147483648);
+ assertEq(x & 2147483648, 0);
+ assertEq(2147483648 & x, 0);
+ assertEq(x ^ 2147483648, -2147483648);
+ assertEq(2147483648 ^ x, -2147483648);
+ assertEq(x >> 2147483648, 0);
+ assertEq(2147483648 >> x, -2147483648);
+ assertEq(x >>> 2147483648, 0);
+ assertEq(2147483648 >>> x, 2147483648);
+ assertEq(x << 2147483648, 0);
+ assertEq(2147483648 << x, -2147483648);
+ assertEq(x | 4294967296, 0);
+ assertEq(4294967296 | x, 0);
+ assertEq(x & 4294967296, 0);
+ assertEq(4294967296 & x, 0);
+ assertEq(x ^ 4294967296, 0);
+ assertEq(4294967296 ^ x, 0);
+ assertEq(x >> 4294967296, 0);
+ assertEq(4294967296 >> x, 0);
+ assertEq(x >>> 4294967296, 0);
+ assertEq(4294967296 >>> x, 0);
+ assertEq(x << 4294967296, 0);
+ assertEq(4294967296 << x, 0);
+ assertEq(x | undefined, 0);
+ assertEq(undefined | x, 0);
+ assertEq(x & undefined, 0);
+ assertEq(undefined & x, 0);
+ assertEq(x ^ undefined, 0);
+ assertEq(undefined ^ x, 0);
+ assertEq(x >> undefined, 0);
+ assertEq(undefined >> x, 0);
+ assertEq(x >>> undefined, 0);
+ assertEq(undefined >>> x, 0);
+ assertEq(x << undefined, 0);
+ assertEq(undefined << x, 0);
+ assertEq(x | null, 0);
+ assertEq(null | x, 0);
+ assertEq(x & null, 0);
+ assertEq(null & x, 0);
+ assertEq(x ^ null, 0);
+ assertEq(null ^ x, 0);
+ assertEq(x >> null, 0);
+ assertEq(null >> x, 0);
+ assertEq(x >>> null, 0);
+ assertEq(null >>> x, 0);
+ assertEq(x << null, 0);
+ assertEq(null << x, 0);
+ assertEq(x | false, 0);
+ assertEq(false | x, 0);
+ assertEq(x & false, 0);
+ assertEq(false & x, 0);
+ assertEq(x ^ false, 0);
+ assertEq(false ^ x, 0);
+ assertEq(x >> false, 0);
+ assertEq(false >> x, 0);
+ assertEq(x >>> false, 0);
+ assertEq(false >>> x, 0);
+ assertEq(x << false, 0);
+ assertEq(false << x, 0);
+ assertEq(x | true, 1);
+ assertEq(true | x, 1);
+ assertEq(x & true, 0);
+ assertEq(true & x, 0);
+ assertEq(x ^ true, 1);
+ assertEq(true ^ x, 1);
+ assertEq(x >> true, 0);
+ assertEq(true >> x, 1);
+ assertEq(x >>> true, 0);
+ assertEq(true >>> x, 1);
+ assertEq(x << true, 0);
+ assertEq(true << x, 1);
+ assertEq(x | -1.5, -1);
+ assertEq(-1.5 | x, -1);
+ assertEq(x & -1.5, 0);
+ assertEq(-1.5 & x, 0);
+ assertEq(x ^ -1.5, -1);
+ assertEq(-1.5 ^ x, -1);
+ assertEq(x >> -1.5, 0);
+ assertEq(-1.5 >> x, -1);
+ assertEq(x >>> -1.5, 0);
+ assertEq(-1.5 >>> x, 4294967295);
+ assertEq(x << -1.5, 0);
+ assertEq(-1.5 << x, -1);
+}
+test2(0)
+
+function test3 (x) {
+ assertEq(x | -1, -1);
+ assertEq(-1 | x, -1);
+ assertEq(x & -1, -1);
+ assertEq(-1 & x, -1);
+ assertEq(x ^ -1, 0);
+ assertEq(-1 ^ x, 0);
+ assertEq(x >> -1, -1);
+ assertEq(-1 >> x, -1);
+ assertEq(x >>> -1, 1);
+ assertEq(-1 >>> x, 1);
+ assertEq(x << -1, -2147483648);
+ assertEq(-1 << x, -2147483648);
+ assertEq(x | 1, -1);
+ assertEq(1 | x, -1);
+ assertEq(x & 1, 1);
+ assertEq(1 & x, 1);
+ assertEq(x ^ 1, -2);
+ assertEq(1 ^ x, -2);
+ assertEq(x >> 1, -1);
+ assertEq(1 >> x, 0);
+ assertEq(x >>> 1, 2147483647);
+ assertEq(1 >>> x, 0);
+ assertEq(x << 1, -2);
+ assertEq(1 << x, -2147483648);
+ assertEq(x | 0, -1);
+ assertEq(0 | x, -1);
+ assertEq(x & 0, 0);
+ assertEq(0 & x, 0);
+ assertEq(x ^ 0, -1);
+ assertEq(0 ^ x, -1);
+ assertEq(x >> 0, -1);
+ assertEq(0 >> x, 0);
+ assertEq(x >>> 0, 4294967295);
+ assertEq(0 >>> x, 0);
+ assertEq(x << 0, -1);
+ assertEq(0 << x, 0);
+ assertEq(x | 0xffffffff, -1);
+ assertEq(0xffffffff | x, -1);
+ assertEq(x & 0xffffffff, -1);
+ assertEq(0xffffffff & x, -1);
+ assertEq(x ^ 0xffffffff, 0);
+ assertEq(0xffffffff ^ x, 0);
+ assertEq(x >> 0xffffffff, -1);
+ assertEq(0xffffffff >> x, -1);
+ assertEq(x >>> 0xffffffff, 1);
+ assertEq(0xffffffff >>> x, 1);
+ assertEq(x << 0xffffffff, -2147483648);
+ assertEq(0xffffffff << x, -2147483648);
+ assertEq(x | "10.6", -1);
+ assertEq("10.6" | x, -1);
+ assertEq(x & "10.6", 10);
+ assertEq("10.6" & x, 10);
+ assertEq(x ^ "10.6", -11);
+ assertEq("10.6" ^ x, -11);
+ assertEq(x >> "10.6", -1);
+ assertEq("10.6" >> x, 0);
+ assertEq(x >>> "10.6", 4194303);
+ assertEq("10.6" >>> x, 0);
+ assertEq(x << "10.6", -1024);
+ assertEq("10.6" << x, 0);
+ assertEq(x | 2147483648, -1);
+ assertEq(2147483648 | x, -1);
+ assertEq(x & 2147483648, -2147483648);
+ assertEq(2147483648 & x, -2147483648);
+ assertEq(x ^ 2147483648, 2147483647);
+ assertEq(2147483648 ^ x, 2147483647);
+ assertEq(x >> 2147483648, -1);
+ assertEq(2147483648 >> x, -1);
+ assertEq(x >>> 2147483648, 4294967295);
+ assertEq(2147483648 >>> x, 1);
+ assertEq(x << 2147483648, -1);
+ assertEq(2147483648 << x, 0);
+ assertEq(x | 4294967296, -1);
+ assertEq(4294967296 | x, -1);
+ assertEq(x & 4294967296, 0);
+ assertEq(4294967296 & x, 0);
+ assertEq(x ^ 4294967296, -1);
+ assertEq(4294967296 ^ x, -1);
+ assertEq(x >> 4294967296, -1);
+ assertEq(4294967296 >> x, 0);
+ assertEq(x >>> 4294967296, 4294967295);
+ assertEq(4294967296 >>> x, 0);
+ assertEq(x << 4294967296, -1);
+ assertEq(4294967296 << x, 0);
+ assertEq(x | undefined, -1);
+ assertEq(undefined | x, -1);
+ assertEq(x & undefined, 0);
+ assertEq(undefined & x, 0);
+ assertEq(x ^ undefined, -1);
+ assertEq(undefined ^ x, -1);
+ assertEq(x >> undefined, -1);
+ assertEq(undefined >> x, 0);
+ assertEq(x >>> undefined, 4294967295);
+ assertEq(undefined >>> x, 0);
+ assertEq(x << undefined, -1);
+ assertEq(undefined << x, 0);
+ assertEq(x | null, -1);
+ assertEq(null | x, -1);
+ assertEq(x & null, 0);
+ assertEq(null & x, 0);
+ assertEq(x ^ null, -1);
+ assertEq(null ^ x, -1);
+ assertEq(x >> null, -1);
+ assertEq(null >> x, 0);
+ assertEq(x >>> null, 4294967295);
+ assertEq(null >>> x, 0);
+ assertEq(x << null, -1);
+ assertEq(null << x, 0);
+ assertEq(x | false, -1);
+ assertEq(false | x, -1);
+ assertEq(x & false, 0);
+ assertEq(false & x, 0);
+ assertEq(x ^ false, -1);
+ assertEq(false ^ x, -1);
+ assertEq(x >> false, -1);
+ assertEq(false >> x, 0);
+ assertEq(x >>> false, 4294967295);
+ assertEq(false >>> x, 0);
+ assertEq(x << false, -1);
+ assertEq(false << x, 0);
+ assertEq(x | true, -1);
+ assertEq(true | x, -1);
+ assertEq(x & true, 1);
+ assertEq(true & x, 1);
+ assertEq(x ^ true, -2);
+ assertEq(true ^ x, -2);
+ assertEq(x >> true, -1);
+ assertEq(true >> x, 0);
+ assertEq(x >>> true, 2147483647);
+ assertEq(true >>> x, 0);
+ assertEq(x << true, -2);
+ assertEq(true << x, -2147483648);
+ assertEq(x | -1.5, -1);
+ assertEq(-1.5 | x, -1);
+ assertEq(x & -1.5, -1);
+ assertEq(-1.5 & x, -1);
+ assertEq(x ^ -1.5, 0);
+ assertEq(-1.5 ^ x, 0);
+ assertEq(x >> -1.5, -1);
+ assertEq(-1.5 >> x, -1);
+ assertEq(x >>> -1.5, 1);
+ assertEq(-1.5 >>> x, 1);
+ assertEq(x << -1.5, -2147483648);
+ assertEq(-1.5 << x, -2147483648);
+}
+test3(-1)
+
+function test4 (x) {
+ assertEq(x | -1, -1);
+ assertEq(-1 | x, -1);
+ assertEq(x & -1, -2147483648);
+ assertEq(-1 & x, -2147483648);
+ assertEq(x ^ -1, 2147483647);
+ assertEq(-1 ^ x, 2147483647);
+ assertEq(x >> -1, -1);
+ assertEq(-1 >> x, -1);
+ assertEq(x >>> -1, 1);
+ assertEq(-1 >>> x, 4294967295);
+ assertEq(x << -1, 0);
+ assertEq(-1 << x, -1);
+ assertEq(x | 1, -2147483647);
+ assertEq(1 | x, -2147483647);
+ assertEq(x & 1, 0);
+ assertEq(1 & x, 0);
+ assertEq(x ^ 1, -2147483647);
+ assertEq(1 ^ x, -2147483647);
+ assertEq(x >> 1, -1073741824);
+ assertEq(1 >> x, 1);
+ assertEq(x >>> 1, 1073741824);
+ assertEq(1 >>> x, 1);
+ assertEq(x << 1, 0);
+ assertEq(1 << x, 1);
+ assertEq(x | 0, -2147483648);
+ assertEq(0 | x, -2147483648);
+ assertEq(x & 0, 0);
+ assertEq(0 & x, 0);
+ assertEq(x ^ 0, -2147483648);
+ assertEq(0 ^ x, -2147483648);
+ assertEq(x >> 0, -2147483648);
+ assertEq(0 >> x, 0);
+ assertEq(x >>> 0, 2147483648);
+ assertEq(0 >>> x, 0);
+ assertEq(x << 0, -2147483648);
+ assertEq(0 << x, 0);
+ assertEq(x | 0xffffffff, -1);
+ assertEq(0xffffffff | x, -1);
+ assertEq(x & 0xffffffff, -2147483648);
+ assertEq(0xffffffff & x, -2147483648);
+ assertEq(x ^ 0xffffffff, 2147483647);
+ assertEq(0xffffffff ^ x, 2147483647);
+ assertEq(x >> 0xffffffff, -1);
+ assertEq(0xffffffff >> x, -1);
+ assertEq(x >>> 0xffffffff, 1);
+ assertEq(0xffffffff >>> x, 4294967295);
+ assertEq(x << 0xffffffff, 0);
+ assertEq(0xffffffff << x, -1);
+ assertEq(x | "10.6", -2147483638);
+ assertEq("10.6" | x, -2147483638);
+ assertEq(x & "10.6", 0);
+ assertEq("10.6" & x, 0);
+ assertEq(x ^ "10.6", -2147483638);
+ assertEq("10.6" ^ x, -2147483638);
+ assertEq(x >> "10.6", -2097152);
+ assertEq("10.6" >> x, 10);
+ assertEq(x >>> "10.6", 2097152);
+ assertEq("10.6" >>> x, 10);
+ assertEq(x << "10.6", 0);
+ assertEq("10.6" << x, 10);
+ assertEq(x | 2147483648, -2147483648);
+ assertEq(2147483648 | x, -2147483648);
+ assertEq(x & 2147483648, -2147483648);
+ assertEq(2147483648 & x, -2147483648);
+ assertEq(x ^ 2147483648, 0);
+ assertEq(2147483648 ^ x, 0);
+ assertEq(x >> 2147483648, -2147483648);
+ assertEq(2147483648 >> x, -2147483648);
+ assertEq(x >>> 2147483648, 2147483648);
+ assertEq(2147483648 >>> x, 2147483648);
+ assertEq(x << 2147483648, -2147483648);
+ assertEq(2147483648 << x, -2147483648);
+ assertEq(x | 4294967296, -2147483648);
+ assertEq(4294967296 | x, -2147483648);
+ assertEq(x & 4294967296, 0);
+ assertEq(4294967296 & x, 0);
+ assertEq(x ^ 4294967296, -2147483648);
+ assertEq(4294967296 ^ x, -2147483648);
+ assertEq(x >> 4294967296, -2147483648);
+ assertEq(4294967296 >> x, 0);
+ assertEq(x >>> 4294967296, 2147483648);
+ assertEq(4294967296 >>> x, 0);
+ assertEq(x << 4294967296, -2147483648);
+ assertEq(4294967296 << x, 0);
+ assertEq(x | undefined, -2147483648);
+ assertEq(undefined | x, -2147483648);
+ assertEq(x & undefined, 0);
+ assertEq(undefined & x, 0);
+ assertEq(x ^ undefined, -2147483648);
+ assertEq(undefined ^ x, -2147483648);
+ assertEq(x >> undefined, -2147483648);
+ assertEq(undefined >> x, 0);
+ assertEq(x >>> undefined, 2147483648);
+ assertEq(undefined >>> x, 0);
+ assertEq(x << undefined, -2147483648);
+ assertEq(undefined << x, 0);
+ assertEq(x | null, -2147483648);
+ assertEq(null | x, -2147483648);
+ assertEq(x & null, 0);
+ assertEq(null & x, 0);
+ assertEq(x ^ null, -2147483648);
+ assertEq(null ^ x, -2147483648);
+ assertEq(x >> null, -2147483648);
+ assertEq(null >> x, 0);
+ assertEq(x >>> null, 2147483648);
+ assertEq(null >>> x, 0);
+ assertEq(x << null, -2147483648);
+ assertEq(null << x, 0);
+ assertEq(x | false, -2147483648);
+ assertEq(false | x, -2147483648);
+ assertEq(x & false, 0);
+ assertEq(false & x, 0);
+ assertEq(x ^ false, -2147483648);
+ assertEq(false ^ x, -2147483648);
+ assertEq(x >> false, -2147483648);
+ assertEq(false >> x, 0);
+ assertEq(x >>> false, 2147483648);
+ assertEq(false >>> x, 0);
+ assertEq(x << false, -2147483648);
+ assertEq(false << x, 0);
+ assertEq(x | true, -2147483647);
+ assertEq(true | x, -2147483647);
+ assertEq(x & true, 0);
+ assertEq(true & x, 0);
+ assertEq(x ^ true, -2147483647);
+ assertEq(true ^ x, -2147483647);
+ assertEq(x >> true, -1073741824);
+ assertEq(true >> x, 1);
+ assertEq(x >>> true, 1073741824);
+ assertEq(true >>> x, 1);
+ assertEq(x << true, 0);
+ assertEq(true << x, 1);
+ assertEq(x | -1.5, -1);
+ assertEq(-1.5 | x, -1);
+ assertEq(x & -1.5, -2147483648);
+ assertEq(-1.5 & x, -2147483648);
+ assertEq(x ^ -1.5, 2147483647);
+ assertEq(-1.5 ^ x, 2147483647);
+ assertEq(x >> -1.5, -1);
+ assertEq(-1.5 >> x, -1);
+ assertEq(x >>> -1.5, 1);
+ assertEq(-1.5 >>> x, 4294967295);
+ assertEq(x << -1.5, 0);
+ assertEq(-1.5 << x, -1);
+}
+test4(2147483648)
+
+function test5 (x) {
+ assertEq(x | -1, -1);
+ assertEq(-1 | x, -1);
+ assertEq(x & -1, -2147483648);
+ assertEq(-1 & x, -2147483648);
+ assertEq(x ^ -1, 2147483647);
+ assertEq(-1 ^ x, 2147483647);
+ assertEq(x >> -1, -1);
+ assertEq(-1 >> x, -1);
+ assertEq(x >>> -1, 1);
+ assertEq(-1 >>> x, 4294967295);
+ assertEq(x << -1, 0);
+ assertEq(-1 << x, -1);
+ assertEq(x | 1, -2147483647);
+ assertEq(1 | x, -2147483647);
+ assertEq(x & 1, 0);
+ assertEq(1 & x, 0);
+ assertEq(x ^ 1, -2147483647);
+ assertEq(1 ^ x, -2147483647);
+ assertEq(x >> 1, -1073741824);
+ assertEq(1 >> x, 1);
+ assertEq(x >>> 1, 1073741824);
+ assertEq(1 >>> x, 1);
+ assertEq(x << 1, 0);
+ assertEq(1 << x, 1);
+ assertEq(x | 0, -2147483648);
+ assertEq(0 | x, -2147483648);
+ assertEq(x & 0, 0);
+ assertEq(0 & x, 0);
+ assertEq(x ^ 0, -2147483648);
+ assertEq(0 ^ x, -2147483648);
+ assertEq(x >> 0, -2147483648);
+ assertEq(0 >> x, 0);
+ assertEq(x >>> 0, 2147483648);
+ assertEq(0 >>> x, 0);
+ assertEq(x << 0, -2147483648);
+ assertEq(0 << x, 0);
+ assertEq(x | 0xffffffff, -1);
+ assertEq(0xffffffff | x, -1);
+ assertEq(x & 0xffffffff, -2147483648);
+ assertEq(0xffffffff & x, -2147483648);
+ assertEq(x ^ 0xffffffff, 2147483647);
+ assertEq(0xffffffff ^ x, 2147483647);
+ assertEq(x >> 0xffffffff, -1);
+ assertEq(0xffffffff >> x, -1);
+ assertEq(x >>> 0xffffffff, 1);
+ assertEq(0xffffffff >>> x, 4294967295);
+ assertEq(x << 0xffffffff, 0);
+ assertEq(0xffffffff << x, -1);
+ assertEq(x | "10.6", -2147483638);
+ assertEq("10.6" | x, -2147483638);
+ assertEq(x & "10.6", 0);
+ assertEq("10.6" & x, 0);
+ assertEq(x ^ "10.6", -2147483638);
+ assertEq("10.6" ^ x, -2147483638);
+ assertEq(x >> "10.6", -2097152);
+ assertEq("10.6" >> x, 10);
+ assertEq(x >>> "10.6", 2097152);
+ assertEq("10.6" >>> x, 10);
+ assertEq(x << "10.6", 0);
+ assertEq("10.6" << x, 10);
+ assertEq(x | 2147483648, -2147483648);
+ assertEq(2147483648 | x, -2147483648);
+ assertEq(x & 2147483648, -2147483648);
+ assertEq(2147483648 & x, -2147483648);
+ assertEq(x ^ 2147483648, 0);
+ assertEq(2147483648 ^ x, 0);
+ assertEq(x >> 2147483648, -2147483648);
+ assertEq(2147483648 >> x, -2147483648);
+ assertEq(x >>> 2147483648, 2147483648);
+ assertEq(2147483648 >>> x, 2147483648);
+ assertEq(x << 2147483648, -2147483648);
+ assertEq(2147483648 << x, -2147483648);
+ assertEq(x | 4294967296, -2147483648);
+ assertEq(4294967296 | x, -2147483648);
+ assertEq(x & 4294967296, 0);
+ assertEq(4294967296 & x, 0);
+ assertEq(x ^ 4294967296, -2147483648);
+ assertEq(4294967296 ^ x, -2147483648);
+ assertEq(x >> 4294967296, -2147483648);
+ assertEq(4294967296 >> x, 0);
+ assertEq(x >>> 4294967296, 2147483648);
+ assertEq(4294967296 >>> x, 0);
+ assertEq(x << 4294967296, -2147483648);
+ assertEq(4294967296 << x, 0);
+ assertEq(x | undefined, -2147483648);
+ assertEq(undefined | x, -2147483648);
+ assertEq(x & undefined, 0);
+ assertEq(undefined & x, 0);
+ assertEq(x ^ undefined, -2147483648);
+ assertEq(undefined ^ x, -2147483648);
+ assertEq(x >> undefined, -2147483648);
+ assertEq(undefined >> x, 0);
+ assertEq(x >>> undefined, 2147483648);
+ assertEq(undefined >>> x, 0);
+ assertEq(x << undefined, -2147483648);
+ assertEq(undefined << x, 0);
+ assertEq(x | null, -2147483648);
+ assertEq(null | x, -2147483648);
+ assertEq(x & null, 0);
+ assertEq(null & x, 0);
+ assertEq(x ^ null, -2147483648);
+ assertEq(null ^ x, -2147483648);
+ assertEq(x >> null, -2147483648);
+ assertEq(null >> x, 0);
+ assertEq(x >>> null, 2147483648);
+ assertEq(null >>> x, 0);
+ assertEq(x << null, -2147483648);
+ assertEq(null << x, 0);
+ assertEq(x | false, -2147483648);
+ assertEq(false | x, -2147483648);
+ assertEq(x & false, 0);
+ assertEq(false & x, 0);
+ assertEq(x ^ false, -2147483648);
+ assertEq(false ^ x, -2147483648);
+ assertEq(x >> false, -2147483648);
+ assertEq(false >> x, 0);
+ assertEq(x >>> false, 2147483648);
+ assertEq(false >>> x, 0);
+ assertEq(x << false, -2147483648);
+ assertEq(false << x, 0);
+ assertEq(x | true, -2147483647);
+ assertEq(true | x, -2147483647);
+ assertEq(x & true, 0);
+ assertEq(true & x, 0);
+ assertEq(x ^ true, -2147483647);
+ assertEq(true ^ x, -2147483647);
+ assertEq(x >> true, -1073741824);
+ assertEq(true >> x, 1);
+ assertEq(x >>> true, 1073741824);
+ assertEq(true >>> x, 1);
+ assertEq(x << true, 0);
+ assertEq(true << x, 1);
+ assertEq(x | -1.5, -1);
+ assertEq(-1.5 | x, -1);
+ assertEq(x & -1.5, -2147483648);
+ assertEq(-1.5 & x, -2147483648);
+ assertEq(x ^ -1.5, 2147483647);
+ assertEq(-1.5 ^ x, 2147483647);
+ assertEq(x >> -1.5, -1);
+ assertEq(-1.5 >> x, -1);
+ assertEq(x >>> -1.5, 1);
+ assertEq(-1.5 >>> x, 4294967295);
+ assertEq(x << -1.5, 0);
+ assertEq(-1.5 << x, -1);
+}
+test5(-2147483648)
+
+