summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/reload1.C
blob: 0d8fb894e4e10fb29d6f2ca6f5e01231cd1a391b (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
// PR 7944
// { dg-do compile }
// { dg-options -O2 }

struct B
{
  B & operator << (short s)
  {
    int j;
    if (j)
        return operator << (s);
    else
        return operator << (s);
  }
};

struct A
{
  int i;
  static void bar ();
  static int quux ()
  {
    bar ();
    return 0;
  }

  A ():i (quux ())
  {
  }
  ~A ()
  {
  }
};

void
foo ()
{
  short s[4] = { 0, 0, 0, 1 };
  A a[2] = { A (), A () };

  B b;
  b << s[0] << s[2];
}