aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/g++.dg/lto/pr52605_0.C
blob: 22540abf9e46ed3004121d948833ec07aca109a6 (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
// { dg-lto-do link }
// { dg-lto-options {{-flto -g}} }

extern "C" void abort (void);

class A
{
public:
  virtual int foo (int i);
};

int A::foo (int i)
{
  return i + 1;
}

int __attribute__ ((noinline,noclone)) get_input(void)
{
  return 1;
}

int main (int argc, char *argv[])
{

  class B : public A
  {
  public:
    int bar (int i)
    {
      return foo (i) + 2;
    }
  };
  class B b;

  if (b.bar (get_input ()) != 4)
    abort ();
  return 0;
}