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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [ptrmem3.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-options "-O1" }
2
 
3
#include 
4
struct A {
5
     A(int arg) : ia(arg) {}
6
     int x,y,z,ia;
7
     int mf(int arg) { return arg + ia; }
8
};
9
int func(int A::*pdm, int (A::*pmf)(int)) //      2.      regular function
10
{
11
     A oa(2);
12
     return ((&oa)->*pdm) + (oa.*pmf)(2);
13
}
14
int main()
15
{
16
     int val;
17
 
18
     int A::*pda = &A::ia;
19
     int (A::*pmfa)(int) = &A::mf;
20
     val = func( pda, pmfa );
21
     if(val != 6)
22
       printf("val=%d, expect 6 \n", val);
23
}

powered by: WebSVN 2.1.0

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