gcc/testsuite/gcc.dg/torture/pr120736.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-additional-options "-fsigned-char -fno-strict-aliasing -fwrapv" } */ |
| 3 | |
| 4 | unsigned char aa (unsigned char ab, int o) { return ab > o ? ab : 0; } |
| 5 | int p; |
| 6 | int s; |
| 7 | static unsigned char q = 255; |
| 8 | int r; |
| 9 | int *v = &s; |
| 10 | int main() { |
| 11 | p = v != 0; |
| 12 | for (; r < 8; ++r) { |
| 13 | if (s) |
| 14 | break; |
| 15 | s = aa(p * q++, 6) <= 0; |
| 16 | } |
| 17 | if (q != 1) |
| 18 | __builtin_abort (); |
| 19 | __builtin_exit (0); |
| 20 | } |
| 21 |