Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
de695d2c
Commit
de695d2c
authored
24 years ago
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
From-SVN: r34374
parent
2bf105ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
gcc/testsuite/g++.old-deja/g++.eh/rethrow6.C
+75
-0
No files found.
gcc/testsuite/g++.old-deja/g++.eh/rethrow6.C
0 → 100644
View file @
de695d2c
// Testcase for proper handling of rethrow.
#include <stdio.h>
int
c
,
d
;
int
wrong
;
struct
A
{
int
i
;
A
()
{
i
=
c
++
;
printf
(
"A() %d
\n
"
,
i
);
}
A
(
const
A
&
)
{
i
=
c
++
;
printf
(
"A(const A&) %d
\n
"
,
i
);
}
~
A
()
{
printf
(
"~A() %d
\n
"
,
i
);
++
d
;
}
};
struct
B
{
~
B
()
{
try
{
printf
(
"Rethrowing III...
\n
"
);
throw
;
}
catch
(
A
&
a
)
{
printf
(
"Caught III %d...
\n
"
,
a
.
i
);
if
(
a
.
i
!=
1
)
{
printf
(
"** rethrew uncaught exception **
\n
"
);
wrong
=
1
;
}
}
printf
(
"continuing to unwind II...
\n
"
);
}
};
int
main
()
{
{
A
a
;
try
{
try
{
printf
(
"Throwing I...
\n
"
);
throw
a
;
}
catch
(
A
&
a
)
{
printf
(
"Caught I %d...
\n
"
,
a
.
i
);
try
{
B
b
;
printf
(
"Throwing II...
\n
"
);
throw
a
;
}
catch
(
A
&
a
)
{
printf
(
"Caught II %d...
\n
"
,
a
.
i
);
printf
(
"Throwing IV...
\n
"
);
throw
;
}
}
}
catch
(
A
&
a
)
{
printf
(
"Caught IV %d.
\n
"
,
a
.
i
);
}
}
printf
(
"c == %d, d == %d
\n
"
,
c
,
d
);
return
c
!=
d
||
wrong
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment