OSDN Git Service

Fix PR 17408 and PR 17409.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20030125-1.c
1 /* Verify whether math functions are simplified.  */
2 double sin(double);
3 double floor(double);
4 float 
5 t(float a)
6 {
7         return sin(a);
8 }
9 float 
10 q(float a)
11 {
12         return floor(a);
13 }
14 double
15 q1(float a)
16 {
17         return floor(a);
18 }
19 float
20 q2(double a)
21 {
22         return floor(a);
23 }
24 main()
25 {
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;
37 }
38 __attribute__ ((noinline))
39 double
40 floor(double a)
41 {
42         abort ();
43 }
44 __attribute__ ((noinline))
45 float
46 floorf(float a)
47 {
48         return a;
49 }
50 __attribute__ ((noinline))
51 double
52 sin(double a)
53 {
54         abort ();
55 }
56 __attribute__ ((noinline))
57 float
58 sinf(float a)
59 {
60         return a;
61 }