aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
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