summaryrefslogtreecommitdiff
path: root/test/unit.asm.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-04-18 17:27:32 -0700
committerGitHub <noreply@github.com>2017-04-18 17:27:32 -0700
commitc945f3be7732e77402d696389482b290be7626cd (patch)
tree4c7b5ccbe6f57ff4ec5aa9e89bc298f38dc5408f /test/unit.asm.js
parent0dc8efbf7f5ac474fadff934eb78cd5f8551d0bb (diff)
parenta9b1d78072bd1875d926cfb0ae51a6eb4dc49b4e (diff)
downloadbinaryen-c945f3be7732e77402d696389482b290be7626cd.tar.gz
binaryen-c945f3be7732e77402d696389482b290be7626cd.tar.bz2
binaryen-c945f3be7732e77402d696389482b290be7626cd.zip
Merge pull request #976 from WebAssembly/fix-f2u
Fix asm2wasm unsigned float-to-int
Diffstat (limited to 'test/unit.asm.js')
-rw-r--r--test/unit.asm.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 11de89c60..9d5f40aea 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -680,8 +680,19 @@ function asm(global, env, buffer) {
return +(+Math_sqrt(x) + +Math_fround(Math_sqrt(Math_fround(x))));
}
+ function f2u(x) {
+ x = +x;
+ return (~~x>>>0) | 0;
+ }
+ function f2s(x) {
+ x = +x;
+ return (~~x) | 0;
+ }
+
function keepAlive() {
sqrts(3.14159);
+ f2u(100.0);
+ f2s(100.0);
}
function v() {