Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / ipa / devirt-30.C
blobc4ac6940a9833fbf292b643fe6c8434914c16d0c
1 // PR c++/58678
2 // { dg-options "-O3 -fdump-ipa-devirt" }
4 // We shouldn't speculatively devirtualize to ~B because B is an abstract
5 // class; any actual object passed to f will be of some derived class which
6 // has its own destructor.
8 struct A
10   virtual void f() = 0;
11   virtual ~A();
14 struct B : A
16   virtual ~B() {}
19 void f(B* b)
21   delete b;
24 // { dg-final { scan-ipa-dump-not "Speculatively devirtualizing" "devirt" } }
25 // { dg-final { cleanup-ipa-dump "devirt" } }