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++.jason/] [net2.C] - Diff between revs 305 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// Test of various ?: problems.
// Test of various ?: problems.
class D
class D
{
{
public:
public:
  void a();
  void a();
  void b();
  void b();
  D(int i):x(i) {}
  D(int i):x(i) {}
private:
private:
  int x;
  int x;
};
};
void D::a() {++x;}
void D::a() {++x;}
void D::b() {--x;}
void D::b() {--x;}
int aa=1, bb=0;
int aa=1, bb=0;
int fa() {return 0;}
int fa() {return 0;}
int fb() {return 2;}
int fb() {return 2;}
int main(int argc, char* argv[])
int main(int argc, char* argv[])
{
{
  typedef int* pi;
  typedef int* pi;
  int* p = (argc == 1)? &aa: &bb;
  int* p = (argc == 1)? &aa: &bb;
  *p = 0;
  *p = 0;
  typedef int (*ifptr)();
  typedef int (*ifptr)();
  ifptr fp = (argc == 1)? fa: fb;
  ifptr fp = (argc == 1)? fa: fb;
  aa = fp();
  aa = fp();
  D d(0);
  D d(0);
  typedef void (D::*dmem)();
  typedef void (D::*dmem)();
  dmem mfp = (argc == 1)? &D::a: &D::b;
  dmem mfp = (argc == 1)? &D::a: &D::b;
  (d.*mfp)();
  (d.*mfp)();
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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