URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ipa/] [devirt-g-1.C] - Rev 693
Compare with Previous | Blame | View Log
// { dg-do compile }
// { dg-options "-O2 -fdump-ipa-cp -fdump-tree-optimized" }
struct S { S(); virtual void xyzzy(); void otherstuff(); };
struct R { int a; S s; R(); };
S s;
R r;
void S::xyzzy ()
{
otherstuff ();
otherstuff ();
}
static void __attribute__ ((noinline)) foo(S *p) { p->xyzzy(); }
void bar() {foo(&s); }
static void __attribute__ ((noinline)) foh(S *p) { p->xyzzy(); }
void bah() {foh(&r.s); }
/* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*S::xyzzy" "cp" } } */
/* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */