1 /* Verify whether math functions are simplified. */ 2 /* { dg-require-effective-target c99_runtime } */ 3 /* { dg-require-weak } */ 4 double sin(double); 5 double floor(double); 6 float t(float a)7t(float a) 8 { 9 return sin(a); 10 } 11 float q(float a)12q(float a) 13 { 14 return floor(a); 15 } 16 double q1(float a)17q1(float a) 18 { 19 return floor(a); 20 } main()21main() 22 { 23 #ifdef __OPTIMIZE__ 24 if (t(0)!=0) 25 abort (); 26 if (q(0)!=0) 27 abort (); 28 if (q1(0)!=0) 29 abort (); 30 #endif 31 return 0; 32 } 33 __attribute__ ((weak)) 34 double floor(double a)35floor(double a) 36 { 37 abort (); 38 } 39 __attribute__ ((weak)) 40 float floorf(float a)41floorf(float a) 42 { 43 return a; 44 } 45 __attribute__ ((weak)) 46 double sin(double a)47sin(double a) 48 { 49 return a; 50 } 51 __attribute__ ((weak)) 52 float sinf(float a)53sinf(float a) 54 { 55 abort (); 56 } 57