diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-02-28 11:00:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-28 11:00:34 -0800 |
commit | 9607b1b7692edad2fe379ade5ee146132fa5f0d7 (patch) | |
tree | 015b2cfc97e482750ad436541e69a687330dbb76 /test/use-import-and-drop.asm.js | |
parent | 6df76ac7cffc27ed181f26b40b63676bfecb78b2 (diff) | |
download | binaryen-9607b1b7692edad2fe379ade5ee146132fa5f0d7.tar.gz binaryen-9607b1b7692edad2fe379ade5ee146132fa5f0d7.tar.bz2 binaryen-9607b1b7692edad2fe379ade5ee146132fa5f0d7.zip |
asm2wasm import overloading fix (#924)
* asm2wasm should not promote an overloaded import result to f64 if it is a single type and void
Diffstat (limited to 'test/use-import-and-drop.asm.js')
-rw-r--r-- | test/use-import-and-drop.asm.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/use-import-and-drop.asm.js b/test/use-import-and-drop.asm.js new file mode 100644 index 000000000..57688ced9 --- /dev/null +++ b/test/use-import-and-drop.asm.js @@ -0,0 +1,19 @@ +Module["asm"] = (function(global, env, buffer) { + "use asm"; + var setTempRet0=env.setTempRet0; + var Math_imul = global.Math.imul; + function test1() { + var $b$1 = 0, $x_sroa_0_0_extract_trunc = 0, $2 = 0, $1$1 = 0, $1$0 = 0; + // Here we use setTempRet0 as if it returns i32, and later as if no return value. + // We should *not* expand the return type to f64, as this is not an overloaded return value + return (setTempRet0((((Math_imul($b$1, $x_sroa_0_0_extract_trunc) | 0) + $2 | 0) + $1$1 | $1$1 & 0) | 0), 0 | $1$0 & -1) | 0; + } + function test2() { + setTempRet0(10); + } + return { + }; +}); + + + |