| 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 |
|
| 7 |
extern void abort (void); |
| 8 |
extern void exit (int); |
| 9 |
|
| 10 |
void foo (int x) |
| 11 |
{ |
| 12 |
if (x != 1) |
| 13 |
abort (); |
| 14 |
} |
| 15 |
|
| 16 |
int z; |
| 17 |
|
| 18 |
int 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 |
} |