Rebase.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / devirt-10.C
blob658442e3451a34acf8f32192fbd0f999c91a565e
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-ipa-inline -fdump-ipa-cp -fno-early-inlining" } */
3 class wxPaintEvent {  };
4 struct wxDCBase
5
6   wxDCBase ();
7   virtual int GetLayoutDirection() const{}
8   virtual void SetLayoutDirection(int){}
9 };
10 struct wxWindowDC  : public wxDCBase {};
11 struct wxBufferedDC  : public wxDCBase
12
13   void Init(wxDCBase*dc) {
14     InitCommon(dc);
15   }
16   void InitCommon(wxDCBase*dc) {
17     if (dc)
18       SetLayoutDirection(dc->GetLayoutDirection());
19   }
21 struct wxBufferedPaintDC  : public wxBufferedDC {
22   wxBufferedPaintDC() {
23     Init(&m_paintdc);
24   }
25  wxWindowDC m_paintdc;
27 void  OnPaint(wxPaintEvent & event) {
28   wxBufferedPaintDC dc;
30 /* IPA-CP should really discover both cases, but for time being the second is handled by inliner.  */
31 /* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "inline"  } } */
32 /* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "cp"  } } */
33 /* { dg-final { cleanup-ipa-dump "inline" } } */
34 /* { dg-final { cleanup-ipa-dump "cp" } } */