2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20030125-1.c
blobdef6fabba0087a2ce6f60a8c65880ed31062d122
1 /* Verify whether math functions are simplified. */
2 double sin(double);
3 double floor(double);
4 float
5 t(float a)
7 return sin(a);
9 float
10 q(float a)
12 return floor(a);
14 double
15 q1(float a)
17 return floor(a);
19 float
20 q2(double a)
22 return floor(a);
24 main()
26 #ifdef __OPTIMIZE__
27 if (t(0)!=0)
28 abort ();
29 if (q(0)!=0)
30 abort ();
31 if (q1(0)!=0)
32 abort ();
33 if (q2(0)!=0)
34 abort ();
35 #endif
36 return 0;
38 __attribute__ ((noinline))
39 double
40 floor(double a)
42 abort ();
44 __attribute__ ((noinline))
45 float
46 floorf(float a)
48 return a;
50 __attribute__ ((noinline))
51 double
52 sin(double a)
54 abort ();
56 __attribute__ ((noinline))
57 float
58 sinf(float a)
60 return a;