summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr60131.C
blob: 23dde316df0baf48d372ee2e3067752357786676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do compile }
struct A { short a; };
int **b;
unsigned long c;

bool foo ();
unsigned bar (unsigned i);
extern void baz () __attribute__((noreturn));

int *
test (unsigned x, struct A *y)
{
  unsigned v;
  if (foo () || y[x].a == -1)
    {
      c = bar (x);
      return 0;
    }
  v = y[x].a;
  if (v >= 23)
    baz ();
  return b[v];
}