2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / pr84821.C
blob39da3671eec13decd0426fe07f7fc2cd869e1b35
1 // { dg-do compile }
2 // { dg-options "-O2" }
3 // { dg-additional-options "-fPIC" { target fpic } }
5 typedef struct a *b;
6 struct a {
7   int c;
8   unsigned d[];
9 };
10 int e, f, g, i, l, m;
11 struct o {
12   long *h;
13   int c;
14   unsigned j;
15   int k;
16   long aa;
18 inline void p(o *r) { r->c = g; }
19 int *n, *ab;
20 inline bool s(o *r) {
21   for (; r->aa == 0; r->aa = r->h[r->j])
22     if (r->j >= r->c)
23       return false;
24   r->aa >>= 1;
25   for (; r->aa;)
26     r++;
27   *n = r->k;
28   return true;
30 class t {
31 public:
32   t(int);
33   operator b() { return q; }
34   b q;
36 bool u, v, ac;
37 void fn3() {
38   long w, x;
39   o ad;
40   bool ae;
41   t af(i), ag(i);
42   for (p(&ad); s(&ad);) {
43     a *ah = af, *ai = ah, *aj = ag;
44     x = ai->d[e] >> f & 1;
45     ae = x;
46     ai = aj;
47     w = ai->d[e] >> f & 1;
48     ac = w;
49     if (v && u && w && x)
50       ab[l] = ++m;
51     u = x;
52   }
53   for (;;)
54     ;