RISC-V: Describe -march behavior for dependent extensions
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20030125-1.c
blob1c2ae1724dc24eed35f3ce874b2cf7abe2524d61
1 /* Verify whether math functions are simplified. */
2 /* { dg-require-effective-target c99_runtime } */
3 /* { dg-require-weak "" } */
4 void abort(void);
5 double sin(double);
6 double floor(double);
7 float
8 t(float a)
10 return sin(a);
12 float
13 q(float a)
15 return floor(a);
17 double
18 q1(float a)
20 return floor(a);
22 int
23 main(void)
25 #ifdef __OPTIMIZE__
26 if (t(0)!=0)
27 abort ();
28 if (q(0)!=0)
29 abort ();
30 if (q1(0)!=0)
31 abort ();
32 #endif
33 return 0;
35 __attribute__ ((weak))
36 double
37 floor(double a)
39 abort ();
41 __attribute__ ((weak))
42 float
43 floorf(float a)
45 return a;
47 __attribute__ ((weak))
48 double
49 sin(double a)
51 return a;
53 __attribute__ ((weak))
54 float
55 sinf(float a)
57 abort ();