Debian Codegraph @

gcc/testsuite/g++.dg/ipa/devirt-9.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-whole-program" } */
3 double foo ();
4 struct B
5 {
6 bool b1 () { return b3 (); }
7 void b2 ();
8 virtual bool b3 ();
9 };
10 struct C
11 {
12 C () {}
13 bool
14 c1 (float x, float y)
15 {
16 if (x != c3 || y != c4)
17 c2.b2 ();
18 return c2.b1 ();
19 }
20 B c2;
21 float c3, c4;
22 };
23
24 void
25 bar ()
26 {
27 static C c;
28 c.c1 (60, (int) foo ());
29 }
30 /* We optimize out this call just after early passes. Unfortunately
31 this unreachable removal is not logged in dump file. */
32 /* { dg-final { scan-ipa-dump-not "OBJ_TYPE_REF" "whole-program" } } */