Fix to PR41012
[official-gcc.git] / gcc / testsuite / g++.dg / tree-prof / inline_mismatch_args.C
bloba0d488284b9990b3e97341d3fc157e484a956d9e
1 /* { dg-options "-O2 -fdump-tree-einline2" } */
2 class DocId {
3  public:
4  DocId() { }
5  DocId(const DocId &other) {  }
6 };
8 int g;
9 class Base {
10  public:
11  virtual void Foo(DocId id) { g++; }
14 class Super: public Base {
15  public:
16  void Foo(DocId id) { }
17  void Bar(Base *base, DocId id) __attribute__((noinline));
20 void Super::Bar(Base *base, DocId id) {
21  Super::Foo(id); // direct call is inlined
22  base->Foo(id); // indirect call is marked do not inline
25 int main(void)
27  Base bah;
28  Super baz;
29  DocId gid;
31  baz.Bar(&baz, gid);
32  return 0;
34 /* { dg-final-use { scan-tree-dump "Inlining virtual void Super::Foo" "einline2"} } */                                                                                
35 /* { dg-final-use { scan-tree-dump-not "mismatched arguments" "einline2"} } */                                                                 
36 /* { dg-final-use { cleanup-tree-dump "einline2" } } */