diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-10-30 17:41:01 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-10-30 17:41:01 -0700 |
commit | 0fd1b5602dd4d55abcd264ee7fd48a17c2780271 (patch) | |
tree | c01bbd4a1617b587386f5fcc694c1a2ee8d4daea /test | |
parent | 4a99322972bd744cd97825f6373f1eee3b3d35b1 (diff) | |
download | binaryen-0fd1b5602dd4d55abcd264ee7fd48a17c2780271.tar.gz binaryen-0fd1b5602dd4d55abcd264ee7fd48a17c2780271.tar.bz2 binaryen-0fd1b5602dd4d55abcd264ee7fd48a17c2780271.zip |
fix conversions
Diffstat (limited to 'test')
-rw-r--r-- | test/unit.asm.js | 6 | ||||
-rw-r--r-- | test/unit.wast | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js index 987374fe2..4b706eb26 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -35,6 +35,12 @@ function () { var x = 0; return !x; } + function conversions() { + var i = 0, d = 0.0; + i = ~~d; + d = +(i | 0); + d = +(i >>> 0); + } function z() { } diff --git a/test/unit.wast b/test/unit.wast index 554751130..b331fa74e 100644 --- a/test/unit.wast +++ b/test/unit.wast @@ -131,6 +131,30 @@ (i32.const 0) ) ) + (func $conversions + (local $i i32) + (local $d f64) + (block + (set_local $i + (i32.trunc_s/f64 + (get_local $d) + ) + ) + (set_local $d + (f64.convert_s/i32 + (get_local $i) + ) + ) + (set_local $d + (f64.convert_u/i32 + (i32.shr_u + (get_local $i) + (i32.const 0) + ) + ) + ) + ) + ) (func $z (nop) ) |