1 /* 2 960909-1.c from the execute part of the gcc torture suite. 3 */ 4 5 #include <testfwk.h> 6 7 #ifdef __SDCC 8 #pragma std_c99 9 #endif 10 11 int ffs(int x)12ffs (int x) 13 { 14 int bit, mask; 15 16 if (x == 0) 17 return 0; 18 19 for (bit = 1, mask = 1; !(x & mask); bit++, mask <<= 1) 20 ; 21 22 return bit; 23 } 24 f(int x)25void f (int x) 26 { 27 int y; 28 y = ffs (x) - 1; 29 if (y < 0) 30 ASSERT (0); 31 } 32 33 void testTortureExecute(void)34testTortureExecute (void) 35 { 36 f (1); 37 return; 38 } 39 40