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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [final1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* Verify that final methods are devirtualized */
2
/* { dg-do compile } */
3
/* { dg-options "-fdump-tree-original -std=c++0x"  } */
4
 
5
struct A final
6
{
7
  virtual void foo ()
8
  {
9
  }
10
};
11
 
12
struct B
13
{
14
  virtual void foo () final
15
  {
16
  }
17
};
18
 
19
void fun(A* a, B* b)
20
{
21
  a->foo();
22
  b->foo();
23
}
24
 
25
/* { dg-final { scan-tree-dump-times "A::foo" 2 "original"  } } */
26
/* { dg-final { scan-tree-dump-times "B::foo" 2 "original"  } } */
27
/* { dg-final { cleanup-tree-dump "original" } } */

powered by: WebSVN 2.1.0

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