From 9607b1b7692edad2fe379ade5ee146132fa5f0d7 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 28 Feb 2017 11:00:34 -0800 Subject: asm2wasm import overloading fix (#924) * asm2wasm should not promote an overloaded import result to f64 if it is a single type and void --- test/use-import-and-drop.asm.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/use-import-and-drop.asm.js (limited to 'test/use-import-and-drop.asm.js') 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 { + }; +}); + + + -- cgit v1.2.3