Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / devirt-49.C
blob6beb47ba9afa49beee241ba3c812a789c4cb5b48
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-devirt"  } */
3 struct Interface {
4   virtual ~Interface() {}
5   virtual void virtualFunc() = 0;
6   virtual void virtualFunc2() = 0;
7 };
9 struct Concrete : Interface {
10   int counter_;
11   Concrete() : counter_(0) {}
12   void virtualFunc() { counter_++; }
13   void virtualFunc2() { counter_++; }
16 void test(Interface &c) {
17   c.virtualFunc();
18   c.virtualFunc2();
20 /* { dg-final { scan-ipa-dump "2 speculatively devirtualized" "devirt"  } } */