Test case for PR target/18841.

From-SVN: r91756
This commit is contained in:
Richard Henderson 2004-12-05 12:07:09 -08:00
parent cbb16d8ef6
commit 618a86bf2b
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
// PR target/18841
// { dg-do run }
// { dg-options "-O2" }
extern "C" void abort ();
int r, i1 = 1, i2 = 2, i3 = 3, i4 = 4, i5 = 5;
struct S
{
~S() { r = i1 + i2 + i3 + i4 + i5; }
};
void foo()
{
S s;
throw 1;
}
void bar()
{
try {
foo();
} catch (...) {
}
}
int main()
{
bar();
if (r != 1 + 2 + 3 + 4 + 5)
abort ();
}