aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr103222.c
blob: 9b629f2fc91dc7eae437f7fce0df44145d1c222a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// { dg-do run }
// { dg-options "-std=gnu17 -O2" }

#include <stdint.h>
#include <stdio.h>
int16_t a;
static uint32_t *b ;
static uint8_t func_2();
static int32_t func_1() {
  int16_t a = 1;
  func_2(0, a, a);
  return 0;
}
uint8_t func_2(uint32_t p1, uint32_t p2, uint32_t p3) {
  int p = 0;
  for (15;; a++) {
    for (0;;) {
      if (p2)
        break;
      b = &p2;
      return p2;
    }
     p3 = (p2 = p3, p);
  }
  return 0;
}

int main() {
  func_1();
  if (a != 2)
    __builtin_abort ();
  return 0;
}