aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-9.C
blob: ce4febd9fc4ec66982adfcac87009363943ae6a6 (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
/* { dg-do compile } */
/* { dg-options "-O2  -fdump-ipa-whole-program --param=early-inlining-insns-comdat=0 -fdevirtualize" } */
double foo ();
struct B
{
  bool b1 () { return b3 (); }
  void b2 ();
  virtual bool b3 ();
};
struct C
{
  C () {}
  bool
  c1 (float x, float y)
  {
    if (x != c3 || y != c4)
      c2.b2 ();
    return c2.b1 ();
  }
  B c2;
  float c3, c4;
};

void
bar ()
{
  static C c;
  c.c1 (60, (int) foo ());
}
/* We optimize out this call just after early passes.  Unfortunately
   this unreachable removal is not logged in dump file.  */
/* { dg-final { scan-ipa-dump-not "OBJ_TYPE_REF" "whole-program" } } */
/* { dg-final { cleanup-ipa-dump "whole-program" } } */