Clang as default compiler November 4th

Tijl Coosemans tijl at coosemans.org
Sat Sep 15 13:49:56 UTC 2012


On 15-09-2012 14:48, Roman Divacky wrote:
> Fwiw, this seems to have been fixed as of a few minutes ago.
> 
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120910/150720.html
> 
> Steve, can you please test llvm/clang from (their) svn and report
> back? We can import a newer snapshot if all is ok.

Here's a small test program. You're probably better equipped to test
clang svn.

--------
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

int
main( int argc, char **argv ) {
	double d = strtod( argv[ 1 ], NULL );

	printf( "%e\n", ( double ) cos( d ));
	printf( "%e\n", ( double ) cosf( d ));
	printf( "%e\n", ( double ) cosl( d ));
	return( 0 );
}
--------

This is the current output of clang:

% clang -o cos cos.c -lm
% ./cos 1.23456789e20
6.031937e-01
1.234568e+20
2.814722e-01

The second number (cosf) is wrong. It should be a value between -1 and 1.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20120915/ea040c07/signature.pgp


More information about the freebsd-current mailing list