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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [eh18.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
// { dg-options "-fexceptions" }
// { dg-options "-fexceptions" }
class VB {
class VB {
public:
public:
  int n;
  int n;
  VB (int v) { n = v; }
  VB (int v) { n = v; }
  VB (const VB& o) {
  VB (const VB& o) {
    n = o.n;
    n = o.n;
//    printf("copying VB from %d to %d\n", &o, this);
//    printf("copying VB from %d to %d\n", &o, this);
  }
  }
};
};
class D : public virtual VB {
class D : public virtual VB {
  int j;
  int j;
public:
public:
  D(int i1, int i2) : VB(i2) { j = i1; }
  D(int i1, int i2) : VB(i2) { j = i1; }
  VB& vb() { return *(VB*)this; }
  VB& vb() { return *(VB*)this; }
  const VB& vb() const { return *(const VB*)this; }
  const VB& vb() const { return *(const VB*)this; }
};
};
class pD : private virtual VB {
class pD : private virtual VB {
  int j;
  int j;
public:
public:
  pD(int i1, int i2) : VB(i2) { j = i1; }
  pD(int i1, int i2) : VB(i2) { j = i1; }
  VB& vb() { return *(VB*)this; }
  VB& vb() { return *(VB*)this; }
  const VB& vb() const { return *(const VB*)this; }
  const VB& vb() const { return *(const VB*)this; }
};
};
int main () {
int main () {
  D d(1943, 4279);
  D d(1943, 4279);
  pD pd(3621, 9527);
  pD pd(3621, 9527);
  VB *vb = &d.vb();
  VB *vb = &d.vb();
  VB *pvb = &pd.vb();
  VB *pvb = &pd.vb();
  // A catch of a public virtual base.
  // A catch of a public virtual base.
  try {
  try {
//    printf("Throwing D at %d (VB at %d)\n", &d, vb);
//    printf("Throwing D at %d (VB at %d)\n", &d, vb);
    throw d;
    throw d;
  }
  }
  catch (VB& vb) {
  catch (VB& vb) {
//    printf("Catching VB at %d\n", &vb);
//    printf("Catching VB at %d\n", &vb);
    if (vb.n != 4279)
    if (vb.n != 4279)
      return 1;
      return 1;
  }
  }
  catch (...) {
  catch (...) {
    return 1;
    return 1;
  }
  }
  // A catch of a private virtual base.
  // A catch of a private virtual base.
  try {
  try {
//    printf("Throwing D at %d (VB at %d)\n", &pd, pvb);
//    printf("Throwing D at %d (VB at %d)\n", &pd, pvb);
    throw pd;
    throw pd;
  }
  }
  catch (VB& vb) {
  catch (VB& vb) {
//    printf("Catching VB at %d\n", &vb);
//    printf("Catching VB at %d\n", &vb);
    // This was a private base of the throw object, don't catch it.
    // This was a private base of the throw object, don't catch it.
    return 1;
    return 1;
  }
  }
  catch (...) {
  catch (...) {
  }
  }
}
}
 
 

powered by: WebSVN 2.1.0

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