Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / devirt-g-1.C
blob849b96ee8fda938fbb45707fe065d9e6b09676d2
1 // { dg-do compile }
2 // { dg-options "-O2 -fdump-ipa-cp -fno-ipa-icf -fdump-tree-optimized" }
4 struct S { S(); virtual void xyzzy(); void otherstuff(); };
5 struct R { int a; S s; R(); };
6 S s;
7 R r;
9 void S::xyzzy ()
11   otherstuff ();
12   otherstuff ();
15 static void __attribute__ ((noinline)) foo(S *p) { p->xyzzy(); }
16 void bar() {foo(&s); }
18 static void __attribute__ ((noinline)) foh(S *p) { p->xyzzy(); }
19 void bah() {foh(&r.s); }
21 /* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*S::xyzzy" "cp"  } } */
22 /* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */