OSDN Git Service

PR target/40668
[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 main()
20 {
21 #ifdef __OPTIMIZE__
22         if (t(0)!=0)
23                 abort ();
24         if (q(0)!=0)
25                 abort ();
26         if (q1(0)!=0)
27                 abort ();
28 #endif
29         return 0;
30 }
31 __attribute__ ((noinline))
32 double
33 floor(double a)
34 {
35         abort ();
36 }
37 __attribute__ ((noinline))
38 float
39 floorf(float a)
40 {
41         return a;
42 }
43 __attribute__ ((noinline))
44 double
45 sin(double a)
46 {
47         abort ();
48 }
49 __attribute__ ((noinline))
50 float
51 sinf(float a)
52 {
53         return a;
54 }