Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | |
michael@0 | 2 | /* Test undoing addition in overflow paths when under heavy register pressure. */ |
michael@0 | 3 | |
michael@0 | 4 | function add1(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); } |
michael@0 | 5 | function add2(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); } |
michael@0 | 6 | function add3(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); } |
michael@0 | 7 | add1(0x7ffffff0, 100, 0, 0, 2147483732); |
michael@0 | 8 | add2(-1000, -0x80000000, 0, 0, -2147484648); |
michael@0 | 9 | add3(-0x80000000, -1000, 0, 0, -2147484648); |
michael@0 | 10 | |
michael@0 | 11 | function cadd1(x, a, b, res) { |
michael@0 | 12 | var nres = res + 0; |
michael@0 | 13 | var nb = b + 0; |
michael@0 | 14 | var z = (x + a) + 1000; |
michael@0 | 15 | assertEq(z, nres + nb); |
michael@0 | 16 | } |
michael@0 | 17 | cadd1(0x7ffffff0, 0, 0, 2147484632); |
michael@0 | 18 | |
michael@0 | 19 | function cadd2(x, a, b, res) { |
michael@0 | 20 | var nres = res + 0; |
michael@0 | 21 | var nb = b + 0; |
michael@0 | 22 | var z = (x + a) + (-0x80000000); |
michael@0 | 23 | assertEq(z, nres + nb); |
michael@0 | 24 | } |
michael@0 | 25 | cadd2(-1000, 0, 0, -2147484648); |