gcc/testsuite/gcc.dg/pr103222.c
raw| 1 | // { dg-do run } |
| 2 | // { dg-options "-std=gnu17 -O2" } |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <stdio.h> |
| 6 | int16_t a; |
| 7 | static uint32_t *b ; |
| 8 | static uint8_t func_2(); |
| 9 | static int32_t func_1() { |
| 10 | int16_t a = 1; |
| 11 | func_2(0, a, a); |
| 12 | return 0; |
| 13 | } |
| 14 | uint8_t func_2(uint32_t p1, uint32_t p2, uint32_t p3) { |
| 15 | int p = 0; |
| 16 | for (15;; a++) { |
| 17 | for (0;;) { |
| 18 | if (p2) |
| 19 | break; |
| 20 | b = &p2; |
| 21 | return p2; |
| 22 | } |
| 23 | p3 = (p2 = p3, p); |
| 24 | } |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | int main() { |
| 29 | func_1(); |
| 30 | if (a != 2) |
| 31 | __builtin_abort (); |
| 32 | return 0; |
| 33 | } |