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++.old-deja/] [g++.pt/] [local6.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
extern "C" void abort();
3
 
4
template 
5
int f(T)
6
{
7
  struct S1 {
8
    virtual int foo() { return 1; }
9
  };
10
 
11
  struct S2 : public S1 {
12
    int foo() { return 2; }
13
  };
14
 
15
  S1* s2 = new S2;
16
 
17
  return s2->foo();
18
}
19
 
20
 
21
int main()
22
{
23
  if (f(3) != 2)
24
    abort();
25
}

powered by: WebSVN 2.1.0

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