diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-07-04 16:08:05 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-07-04 16:08:05 -0700 |
commit | b9e43e29b6c9e251334b1de75dec1d04d2013853 (patch) | |
tree | 170578da349f189d92f5b30051e1c40f8c87ac3c /tests | |
parent | 370128e8d9459cfe6469a38be8d0282d9d4f92cd (diff) |
fix a bug with allocate not being told the right number of bytes with single double values, and fix one extra byte being needlessly allocated while we are at it
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 19ef538b..5b005bc4 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1210,6 +1210,35 @@ m_divisor is 1091269979 ''' self.do_run(src, '*1,10,10.5,1,1.2340,0.00*') + def test_globaldoubles(self): + src = r''' + #include <stdlib.h> + #include <stdio.h> + + double testVu, testVv, testWu, testWv; + + void Test(double _testVu, double _testVv, double _testWu, double _testWv) + { + testVu = _testVu; + testVv = _testVv; + testWu = _testWu; + testWv = _testWv; + printf("BUG?\n"); + printf("Display: Vu=%f Vv=%f Wu=%f Wv=%f\n", testVu, testVv, testWu, testWv); + } + + int main(void) + { + double v1 = 465.1; + double v2 = 465.2; + double v3 = 160.3; + double v4 = 111.4; + Test(v1, v2, v3, v4); + return 0; + } + ''' + self.do_run(src, 'BUG?\nDisplay: Vu=465.100000 Vv=465.200000 Wu=160.300000 Wv=111.400000') + def test_math(self): src = ''' #include <stdio.h> |