1010
1111// Prints the float/double/long double versions of the given function
1212// e.g.: TEST(fmax) prints fmaxf : fmax : fmaxl
13- #define TEST (func ) \
14- printf("%f : %f : %Lf\n", \
15- __builtin_##func##f(f1, f2), \
16- __builtin_##func(d1, d2), \
17- __builtin_##func##l(l1, l2));
13+ #define TEST (func ) \
14+ printf("__builtin_" #func " %f : %f : %Lf\n", \
15+ __builtin_##func##f(f1, f2), \
16+ __builtin_##func(d1, d2), \
17+ __builtin_##func##l(l1, l2));
1818
19- #define TESTI (func ) \
20- printf("%f : %f : %Lf\n", \
21- __builtin_##func##f(f1, i1), \
22- __builtin_##func(d1, i1), \
23- __builtin_##func##l(l1, i1));
19+ #define TESTI (func ) \
20+ printf("__builtin_" #func " %f : %f : %Lf\n", \
21+ __builtin_##func##f(f1, i1), \
22+ __builtin_##func(d1, i1), \
23+ __builtin_##func##l(l1, i1));
2424
2525int test_builtins () {
26- int i1 = 88 ;
27- float f1 = 0.1234f ;
28- float f2 = 0.5678f ;
29- double d1 = 1.0101 ;
30- double d2 = 0.10101 ;
31- long double l1 = 12.0123L ;
32- long double l2 = 21.3201L ;
33- TEST (fmax )
34- TEST (fmin )
35- TEST (fmod )
26+ int i1 = 88 ;
27+ float f1 = 0.1234f ;
28+ float f2 = 0.5678f ;
29+ double d1 = 1.0101 ;
30+ double d2 = 0.10101 ;
31+ long double l1 = 12.0123L ;
32+ long double l2 = 21.3201L ;
33+ TEST (fmax )
34+ TEST (fmin )
35+ TEST (fmod )
3636
37- TEST (pow )
38- TESTI (powi )
39- return 0 ;
37+ TEST (pow )
38+ TESTI (powi )
39+ return 0 ;
4040}
4141
4242void test_exp_log (double x ) {
43- double a = exp2 (x );
44- double b = log10 (x );
45- float c = log10f (x );
46- double d = acos (x );
47- printf ("%f : %f : %f : %d\n" , a , b , c , isnan (d ));
43+ double a = exp2 (x );
44+ double b = log10 (x );
45+ float c = log10f (x );
46+ double d = acos (x );
47+ printf ("%f : %f : %f : %d\n" , a , b , c , isnan (d ));
4848}
4949
5050void test_long_double (long double x ) {
@@ -60,10 +60,10 @@ void test_long_double(long double x) {
6060}
6161
6262int main () {
63- puts ("***start***" );
64- test_builtins ();
65- test_exp_log (1234.5678 );
66- test_long_double (16 );
67- puts ("***end***" );
68- return 0 ;
63+ puts ("***start***" );
64+ test_builtins ();
65+ test_exp_log (1234.5678 );
66+ test_long_double (16 );
67+ puts ("***end***" );
68+ return 0 ;
6969}
0 commit comments