gcc/testsuite/gcc.dg/torture/pr111445.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | short a, b; |
| 5 | unsigned char c = 255; |
| 6 | unsigned cnt; |
| 7 | void __attribute__((noipa)) |
| 8 | check (int x) |
| 9 | { |
| 10 | if (x != 0) |
| 11 | abort (); |
| 12 | cnt++; |
| 13 | } |
| 14 | int main() |
| 15 | { |
| 16 | int d; |
| 17 | unsigned char e; |
| 18 | d = 0; |
| 19 | for (; a >= 0; a--) { |
| 20 | int *f = &d; |
| 21 | *f = c; |
| 22 | } |
| 23 | e = 0; |
| 24 | for (; (unsigned char)(d - 255) + e <= 1; e++) |
| 25 | check (b); |
| 26 | if (cnt != 2) |
| 27 | abort (); |
| 28 | return 0; |
| 29 | } |