1 /* 2 pr69097-2.c from the execute part of the gcc torture tests. 3 */ 4 5 #include <testfwk.h> 6 7 #ifdef __SDCC 8 #pragma std_c99 9 #endif 10 11 #include <limits.h> 12 13 /* PR tree-optimization/69097 */ 14 15 int f1(int x,int y)16f1 (int x, int y) 17 { 18 return x % y; 19 } 20 21 int f2(int x,int y)22f2 (int x, int y) 23 { 24 return x % -y; 25 } 26 27 int f3(int x,int y)28f3 (int x, int y) 29 { 30 int z = -y; 31 return x % z; 32 } 33 34 void testTortureExecute(void)35testTortureExecute (void) 36 { 37 if (f1 (-INT_MAX - 1, 1) != 0 38 || f2 (-INT_MAX - 1, -1) != 0 39 || f3 (-INT_MAX - 1, -1) != 0) 40 ASSERT(0); 41 return; 42 } 43