URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// PR target/12301
|
// PR target/12301
|
// Origin: Colin Hirsch
|
// Origin: Colin Hirsch
|
// Testcase by Christian Ehrhardt
|
// Testcase by Christian Ehrhardt
|
|
|
// This used to fail on SPARC because the reorg pass moved an insn
|
// This used to fail on SPARC because the reorg pass moved an insn
|
// across a function call that can throw internally, in order to put
|
// across a function call that can throw internally, in order to put
|
// it in a delay slot.
|
// it in a delay slot.
|
|
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-O" }
|
// { dg-options "-O" }
|
|
|
struct S{
|
struct S{
|
char *c;
|
char *c;
|
char data[100];
|
char data[100];
|
S () : c (data) {};
|
S () : c (data) {};
|
S (const S& s) {
|
S (const S& s) {
|
c = data;
|
c = data;
|
data[0] = s.c[0];
|
data[0] = s.c[0];
|
}
|
}
|
};
|
};
|
|
|
S real_cast ()
|
S real_cast ()
|
{
|
{
|
throw 3;
|
throw 3;
|
}
|
}
|
|
|
S cast_helper(S& debug)
|
S cast_helper(S& debug)
|
{
|
{
|
try {
|
try {
|
return real_cast();
|
return real_cast();
|
}
|
}
|
catch (int e) {
|
catch (int e) {
|
throw debug;
|
throw debug;
|
}
|
}
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
S tmp;
|
S tmp;
|
|
|
try {
|
try {
|
cast_helper (tmp);
|
cast_helper (tmp);
|
}
|
}
|
catch (S& e) {}
|
catch (S& e) {}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.