aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-08-25 11:26:31 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-08-25 11:26:47 -0700
commitc14a675125a6d94d80561e986549280eee5e958d (patch)
treef4bca3b6e2cea17cfef0febab0be8544574472da /tests/runner.py
parentaab3e76b94c09c384e45a98dbb8a95b7b94ca838 (diff)
PRECISE_I32_MUL option for full precision in 32-bit multiply
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 876990d2..32776167 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -953,6 +953,23 @@ m_divisor is 1091269979
'''
self.do_run(src, 'zero 2, 104', ['hallo'])
+ def test_i32_mul_precise(self):
+ if self.emcc_args == None: return self.skip('needs ta2')
+
+ self.emcc_args += ['-s', 'PRECISE_I32_MUL=1']
+ src = r'''
+ #include <stdio.h>
+
+ int main(int argc, char **argv) {
+ unsigned long d1 = 0x847c9b5d;
+ unsigned long q = 0x549530e1;
+ if (argc > 1000) { q += argc; d1 -= argc; } // confuse optimizer
+ printf("%lu\n", d1*q);
+ return 0;
+ }
+ '''
+ self.do_run(src, '3217489085')
+
def test_i16_emcc_intrinsic(self):
Settings.CORRECT_SIGNS = 1 # Relevant to this test