1 /* 2 990106-2.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 calc_mp(unsigned mod)11unsigned calc_mp(unsigned mod) 12 { 13 unsigned a,b,c; 14 c=-1; 15 a=c/mod; 16 b=0-a*mod; 17 if (b > mod) { a += 1; b-=mod; } 18 return b; 19 } 20 21 void testTortureExecute(void)22testTortureExecute (void) 23 { 24 unsigned x = 1234; 25 unsigned y = calc_mp(x); 26 27 if ((sizeof (y) == 4 && y != 680) 28 || (sizeof (y) == 2 && y != 134)) 29 ASSERT (0); 30 return; 31 } 32 33