aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-40.C
blob: 9c3bdf5e9dfabd3b95a243c7712c4fb6284323d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// PR c++/62224
// { dg-options "-O2" }
// For 4.9, we don't want to devirtualize f and thus create a reference to g.

struct A
{
  virtual void f () = 0;
};

class B : A
{
  virtual void f () { g(); }
  void g();
};

void h (A *a)
{
  a->f ();
}

// { dg-final { scan-assembler-not "_ZN1B1gEv" } }