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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [pmf6.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Test that we only call f once and that pointers to different subobjects
3
// compare as different.
4
 
5
struct A { void f() { } };
6
struct B: public A { };
7
struct C: public A { };
8
struct D : public B, public C { };
9
 
10
typedef void (B::*bp)();
11
typedef void (C::*cp)();
12
typedef void (D::*dp)();
13
 
14
dp d1;
15
 
16
int call;
17
 
18
dp f () { ++call; return d1; }
19
 
20
int main()
21
{
22
  bp b = &A::f;
23
  cp c = &A::f;
24
  d1 = b;
25
  dp d2 = c;
26
  return (f() == d2 || call != 1);
27
}

powered by: WebSVN 2.1.0

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