1 /* Verify whether math functions are simplified. */ 2 double sin(double); 3 double floor(double); 4 float t(float a)5t(float a) 6 { 7 return sin(a); 8 } 9 float q(float a)10q(float a) 11 { 12 return floor(a); 13 } 14 double q1(float a)15q1(float a) 16 { 17 return floor(a); 18 } main()19main() 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 floor(double a)33floor(double a) 34 { 35 abort (); 36 } 37 __attribute__ ((noinline)) 38 float floorf(float a)39floorf(float a) 40 { 41 return a; 42 } 43 __attribute__ ((noinline)) 44 double sin(double a)45sin(double a) 46 { 47 abort (); 48 } 49 __attribute__ ((noinline)) 50 float sinf(float a)51sinf(float a) 52 { 53 return a; 54 } 55