summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/devirt-13.C
blob: 923c98e92eb94e83a0bfd7f77e38fee69f124886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { 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;

int main()
{
  return b->foo();
}

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