diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-15 14:29:50 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-15 14:33:37 -0800 |
commit | 4f3b5af14cf6bff389765d0f6dd2e5b6c3ba7161 (patch) | |
tree | 80e5ae6b19ec29a0453bd5d279d38929a07459fc /tests/test_core.py | |
parent | 0c4d11f4caaa960cf283a4c2112cbdf6a175cadd (diff) |
ignore llvm ir fast-math notation; fixes #1762
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 481130c5..d7b6cf53 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1408,6 +1408,26 @@ Succeeded! ''' self.do_run(src, '*1,10,10.5,1,1.2340,0.00*\n0.50, 3.30, 3.30, 3.30\nsmall: 0.0000010000\n') + def test_fast_math(self): + if self.emcc_args is None: return self.skip('requires emcc') + Building.COMPILER_TEST_OPTS += ['-ffast-math'] + + self.do_run(r''' +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char** argv) { + char* endptr; + --argc, ++argv; + double total = 0.0; + for (; argc; argc--, argv++) { + total += strtod(*argv, &endptr); + } + printf("total: %g\n", total); + return 0; +} +''', 'total: 19', ['5', '6', '8']) + def test_zerodiv(self): self.do_run(r''' #include <stdio.h> |