1/* This test was miscompiled when using sibling call optimization, 2 because X ? Y : Y - 1 optimization changed X into !X in place 3 and haven't reverted it if do_store_flag was successful, so 4 when expanding the expression the second time it was 5 !X ? Y : Y - 1. */ 6 7extern void abort (void); 8extern void exit (int); 9 10void foo (int x) 11{ 12 if (x != 1) 13 abort (); 14} 15 16int z; 17 18int main (int argc, char **argv) 19{ 20 char *a = "test"; 21 char *b = a + 2; 22 23 foo (z > 0 ? b - a : b - a - 1); 24 exit (0); 25} 26