aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60597.C
blob: c61f7679765df086a0ef5fcab6e8507d624a1ac1 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
// PR middle-end/60597
// { dg-do compile }
// { dg-options "-O2 -g" }

struct A
{
  int foo () const;
  int bar () const;
  int a;
};

struct B
{
  int foo ();
  int bar ();
};

int *c, d;

int
A::foo () const
{
  int b = a >> 16;
  return b;
}

int
A::bar () const
{
  int b = a;
  return b;
}

void
baz (A &x, B h, int i, int j)
{
  for (; i < h.bar (); ++i)
    for (; h.foo (); ++j)
      {
	int g = x.foo ();
	int f = x.bar ();
	int e = c[0] & 1;
	d = (e << 1) | (g << 16) | (f & 1);
	c[j] = 0;
      }
}