diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-09-15 07:42:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-15 07:42:57 -0700 |
commit | 403be53fb84645b9338454681792538af876cf87 (patch) | |
tree | bc61d829b0c47fc7308ae371d41410abf97ebb92 /test/unit.asm.js | |
parent | 559c16ea758d397fe447edbd6b09350e8471d7a6 (diff) | |
download | binaryen-403be53fb84645b9338454681792538af876cf87.tar.gz binaryen-403be53fb84645b9338454681792538af876cf87.tar.bz2 binaryen-403be53fb84645b9338454681792538af876cf87.zip |
fix sign detection of a floating-point mod ; fixes kripken/emscripten#7123 (#1681)
Diffstat (limited to 'test/unit.asm.js')
-rw-r--r-- | test/unit.asm.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js index 82b6bdcd1..05827ce54 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -768,6 +768,13 @@ function asm(global, env, buffer) { emscripten_log(), 2 ? abort() | 0 : 3; } + function mod_detectSign(d1, d2, d8) { + d1 = +d1; + d2 = +d2; + d8 = +d8; + return ~~(d2 - d8 % d1 / d1 * d2); + } + function keepAlive() { sqrts(3.14159); sqrts(2.18281); // don't inline it either @@ -777,6 +784,7 @@ function asm(global, env, buffer) { indirectInSequence(); emterpretify_assertions_safeHeap(); call_emscripten_log(); + mod_detectSign(1.0, 2.31, 9.78); } function v() { |