Fix type in the changelog entry,
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / devirt-47.C
blob043c2d80aa54c1a6c4f670fc71250c5076c95fd9
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-ipa-cp -fdump-ipa-inline-details -fno-early-inlining -fdump-tree-optimized" } */
3 struct A {
4    virtual int foo(){return 1;}
5 };
6 struct B {
7    virtual int bar(){return 4;}
8 };
9 struct C:B,A {
10    virtual int foo(){return 2;}
12 static void
13 test (struct A *a)
15   if (a->foo() != 2)
16    __builtin_abort ();
18 int
19 m()
21   struct A *a = new C;
22   test (a);
23   return 0;
26 /* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target\[^\\n\]*C::_ZTh" 1 "inline"  } } */
27 /* { dg-final { scan-tree-dump-not "OBJ_TYPE_REF" "optimized"  } } */
28 /* FIXME: We ought to inline thunk.  */
29 /* { dg-final { scan-tree-dump "C::_ZThn" "optimized"  } } */