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++.robertl/] [eh990323-4.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// { dg-do run  }
// { dg-do run  }
// check MI and VBC offsets on throw
// check MI and VBC offsets on throw
extern "C" void abort ();
extern "C" void abort ();
extern "C" void exit (int);
extern "C" void exit (int);
struct A {
struct A {
        int x[23];
        int x[23];
};
};
struct B : virtual public A {
struct B : virtual public A {
        int y[33];
        int y[33];
};
};
struct C : virtual public A, public B {
struct C : virtual public A, public B {
        int z[43];
        int z[43];
};
};
struct D {
struct D {
        int xx[53];
        int xx[53];
};
};
struct E : public D, public A {
struct E : public D, public A {
        int yy[63];
        int yy[63];
};
};
C c;
C c;
E e;
E e;
void f1()
void f1()
{
{
        throw (C*)0;
        throw (C*)0;
}
}
void f2()
void f2()
{
{
        throw &c;
        throw &c;
}
}
void f3()
void f3()
{
{
        throw (E*)0;
        throw (E*)0;
}
}
void f4()
void f4()
{
{
        throw &e;
        throw &e;
}
}
int
int
main()
main()
{
{
        int flag;
        int flag;
        flag = 0;
        flag = 0;
        try {
        try {
                f1();
                f1();
        }
        }
        catch (void* p) {
        catch (void* p) {
                if (p)
                if (p)
                        abort();
                        abort();
                flag = 1;
                flag = 1;
        }
        }
        if (!flag)
        if (!flag)
                abort();
                abort();
        flag = 0;
        flag = 0;
        try {
        try {
                f2();
                f2();
        }
        }
        catch (void* p) {
        catch (void* p) {
                if (!p || (void*)p != (void*)&c)
                if (!p || (void*)p != (void*)&c)
                        abort();
                        abort();
                flag = 1;
                flag = 1;
        }
        }
        if (!flag)
        if (!flag)
                abort();
                abort();
        flag = 0;
        flag = 0;
        try {
        try {
                f3();
                f3();
        }
        }
        catch (void* p) {
        catch (void* p) {
                if (p)
                if (p)
                        abort();
                        abort();
                flag = 1;
                flag = 1;
        }
        }
        if (!flag)
        if (!flag)
                abort();
                abort();
        flag = 0;
        flag = 0;
        try {
        try {
                f4();
                f4();
        }
        }
        catch (void* p) {
        catch (void* p) {
                if (!p || (void*)p != (void*)&e)
                if (!p || (void*)p != (void*)&e)
                        abort();
                        abort();
                flag = 1;
                flag = 1;
        }
        }
        if (!flag)
        if (!flag)
                abort();
                abort();
        exit(0);
        exit(0);
}
}
 
 

powered by: WebSVN 2.1.0

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