Closed Quuxplusone closed 12 years ago
This is probably my fault.
Can you confirm that you built this against latest ToT? I fixed a bug that was
almost certainly the cause of this in r161885, and I get the correct result now:
resistor$ ./Debug+Asserts/bin/clang foo.c -o foo
resistor$ ./foo
compiled with: 4.2.1 Compatible Clang 3.2 (trunk 161758) (llvm/trunk 161926)
trunc (-0.5) = -0.000000
trunc (-3.14) = -3.000000
trunc (-2.71) = -2.000000
trunc (-0.1) = -0.000000
Try explicitly declaring "double trunc(double) __attribute((const));"...
Attached a.out
(8504 bytes, application/octet-stream): a.out built with clang 161927 on x86_64 Ubuntu 10.04
(In reply to comment #3)
> Try explicitly declaring "double trunc(double) __attribute((const));"...
I tried replacing "#include <math.h>" with that explicit declaration, but I'm
still getting the same result.
Fixed in r161929.
a.out
(8504 bytes, application/octet-stream)