PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20021204-1.c
blobe92c408a7b59e1cc5dfc2fb945c110bf866f194e
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. */
7 extern void abort (void);
8 extern void exit (int);
10 void foo (int x)
12 if (x != 1)
13 abort ();
16 int z;
18 int main (int argc, char **argv)
20 char *a = "test";
21 char *b = a + 2;
23 foo (z > 0 ? b - a : b - a - 1);
24 exit (0);