OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [tree-prof/] [inline_mismatch_args.C] - Rev 779

Go to most recent revision | Compare with Previous | Blame | View Log

/* { dg-options "-O2 -fdump-tree-einline2" } */
class DocId {
 public:
 DocId() { }
 DocId(const DocId &other) {  }
};

int g;
class Base {
 public:
 virtual void Foo(DocId id) { g++; }
};

class Super: public Base {
 public:
 void Foo(DocId id) { }
 void Bar(Base *base, DocId id) __attribute__((noinline));
};

void Super::Bar(Base *base, DocId id) {
 Super::Foo(id); // direct call is inlined
 base->Foo(id); // indirect call is marked do not inline
}

int main(void)
{
 Base bah;
 Super baz;
 DocId gid;

 baz.Bar(&baz, gid);
 return 0;
}
/* { dg-final-use { scan-tree-dump "Inlining .*Super::Foo" "einline2"} } */                                                                                
/* { dg-final-use { scan-tree-dump-not "mismatched arguments" "einline2"} } */                                                                 
/* { dg-final-use { cleanup-tree-dump "einline2" } } */

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.