1/* PR rtl-optimization/19579 */ 2 3extern void abort (void); 4 5int 6foo (int i, int j) 7{ 8 int k = i + 1; 9 10 if (j) 11 { 12 if (k > 0) 13 k++; 14 else if (k < 0) 15 k--; 16 } 17 18 return k; 19} 20 21int 22main (void) 23{ 24 if (foo (-2, 0) != -1) 25 abort (); 26 if (foo (-1, 0) != 0) 27 abort (); 28 if (foo (0, 0) != 1) 29 abort (); 30 if (foo (1, 0) != 2) 31 abort (); 32 if (foo (-2, 1) != -2) 33 abort (); 34 if (foo (-1, 1) != 0) 35 abort (); 36 if (foo (0, 1) != 2) 37 abort (); 38 if (foo (1, 1) != 3) 39 abort (); 40 return 0; 41} 42