summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/devirt-13.C
blob: fecbbfc93eb0111901c19aeacd77afb418a878e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do run } */
/* Call to foo should be devirtualized because there are no derived types of A.  */
/* { dg-options "-O2 -fdump-tree-ssa"  } */
namespace {
class A {
public:
  virtual int foo(void)
{
  return 0;
}
};
}
class A a, *b=&a;
main()
{
  return b->foo();
}

/* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "ssa"} } */