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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [net26.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// A test case found by InterViews testing...
3
 
4
extern "C" int printf(const char *, ...);
5
 
6
class A {
7
public:
8
        int foo() { printf("ok nv\n"); return 0; }
9
        virtual int vfoo() { printf("ok v\n"); return 0; }
10
};
11
 
12
struct S {
13
        int (A::*pfn1)();
14
        int (A::*pfn2)();
15
        int (A::*pfn3)();
16
};
17
 
18
// This failed before.
19
S s = { &A::foo, &A::vfoo, &A::foo };
20
 
21
A a;
22
 
23
int main() {
24
  (a.*s.pfn1)();
25
  (a.*s.pfn2)();
26
  printf("PASS\n");
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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