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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2" } */
3
 
4
class X {
5
public:
6
  int mfunc1 () {
7
    return 1;
8
  }
9
  int mfunc2 () {
10
    return 2;
11
  }
12
  X (int a, int b) { }
13
};
14
 
15
typedef int (X::*memfunc_p_t) ();
16
 
17
memfunc_p_t mf_arr[2] = { &X::mfunc1, &X::mfunc2 };
18
 
19
int
20
main ()
21
{
22
  // Get pntr to the array of pointers to member-funcs
23
  memfunc_p_t (*mf_arr_p)[2] = &mf_arr;
24
  // Compare indirect against direct access to an array element
25
  if ((*mf_arr_p)[0] != mf_arr[0])
26
    return 1;
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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