Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mingodad committed Dec 17, 2018
1 parent d28cb97 commit 63ac779
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua2ljs/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ lfequal = function(a, b)
end
end

do --- jit shift/xor
local a, b = 0x123456789abcdef0LL, 0x31415926535898LL
for i=1,200 do
a = bxor(a, b); b = sar(b, 14) + shl(b, 50)
a = a - b; b = shl(b, 5) + sar(b, 59)
b = bxor(a, b); b = b - shl(b, 13) - shr(b, 51)
end
assert(b == -7993764627526027113LL)
end

local k
local s = format(0 < k and k < 0x1p-1026 and "%+a" or "%+.14g", k)

Expand Down

0 comments on commit 63ac779

Please sign in to comment.