aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-24 20:25:38 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-24 20:25:38 -0700
commit454b9e41525e40780e80288a83378d128f1cad02 (patch)
tree75a0ecac217eee3b3a3df4738500862edc729bad /tests
parent2ec8c7a23fbc1adee266a1e9bf8ac3f24daf3663 (diff)
parent284026de746adf9ce7aafd5da0ce12fd9a3c94f0 (diff)
Merge pull request #1641 from waywardmonkeys/fix-negative-zero-bug
Fix negative zero bug
Diffstat (limited to 'tests')
-rw-r--r--tests/test_core.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index ea2fe49e..d1d3bab0 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1399,6 +1399,23 @@ f5: nan
f6: nan
''')
+ def test_zero_multiplication(self):
+ src = '''
+ #include <stdio.h>
+ int main(int argc, char * argv[]) {
+ int one = argc;
+
+ printf("%d ", 0 * one);
+ printf("%d ", 0 * -one);
+ printf("%d ", -one * 0);
+ printf("%g ", 0.0 * one);
+ printf("%g ", 0.0 * -one);
+ printf("%g", -one * 0.0);
+ return 0;
+ }
+ '''
+ self.do_run(src, '0 0 0 0 -0 -0')
+
def test_isnan(self):
src = r'''
#include <stdio.h>