gcc/testsuite/gcc.dg/torture/pr101972.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-require-effective-target int32plus } */ |
| 3 | |
| 4 | int a, b, c, d, f; |
| 5 | static short e = 63891; |
| 6 | char g = 30; |
| 7 | unsigned h(int i, int j) { return i << j; } |
| 8 | int *l(int *); |
| 9 | void m() |
| 10 | { |
| 11 | a = 0; |
| 12 | for (; a >= 0; a--) |
| 13 | { |
| 14 | int *k = &b; |
| 15 | *k = e < 0; |
| 16 | } |
| 17 | c = b; |
| 18 | l(&c); |
| 19 | } |
| 20 | int *l(int *i) |
| 21 | { |
| 22 | d = 2; |
| 23 | for (; d <= 6; d++) |
| 24 | { |
| 25 | if (h(d, *i) <= d) |
| 26 | ; |
| 27 | else |
| 28 | continue; |
| 29 | g = 0; |
| 30 | return &f; |
| 31 | } |
| 32 | return (void *)0; |
| 33 | } |
| 34 | int main() |
| 35 | { |
| 36 | m(); |
| 37 | if (g != 30) |
| 38 | __builtin_abort (); |
| 39 | } |