diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-01 18:39:33 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-01 18:39:33 -0700 |
commit | 140ea9e81feb09d8f2559995c73d49a39424ef5d (patch) | |
tree | 53f2baf7fc1fdc0b2689c3ff12a97a2e4e756668 /tests | |
parent | 3d48329892cd517b2e709ef94a00df8214169ddd (diff) |
do not emit unnecessary coercions when calling a math builtin with a float
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_core.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index a19cde10..f3a106a2 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1516,7 +1516,7 @@ f6: nan #include <stdio.h> #include <stdlib.h> #include <cmath> - int main() + int main(int argc, char **argv) { printf("*%.2f,%.2f,%d", M_PI, -M_PI, (1/0.0) > 1e300); // could end up as infinity, or just a very very big number printf(",%d", isfinite(NAN) != 0); @@ -1538,11 +1538,15 @@ f6: nan sincosf(0.0, &fsine, &fcosine); printf(",%1.1f", fsine); printf(",%1.1f", fcosine); + fsine = sinf(1.1 + argc - 1); + fcosine = cosf(1.1 + argc - 1); + printf(",%1.1f", fsine); + printf(",%1.1f", fcosine); printf("*\\n"); return 0; } ''' - self.do_run(src, '*3.14,-3.14,1,0,0,0,1,0,1,1,0,2,3,0.0,1.0,0.0,1.0*') + self.do_run(src, '*3.14,-3.14,1,0,0,0,1,0,1,1,0,2,3,0.0,1.0,0.0,1.0,0.9,0.5*') def test_erf(self): src = ''' |