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
dba21b32
Commit
dba21b32
authored
Mar 25, 1998
by
Brendan Kehoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new test for EH w/ opt on
From-SVN: r18829
parent
8e73900b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
gcc/testsuite/g++.old-deja/g++.brendan/eh1.C
+62
-0
No files found.
gcc/testsuite/g++.old-deja/g++.brendan/eh1.C
0 → 100644
View file @
dba21b32
// Special g++ Options: -O
// PRMS Id: 10776
extern
"C"
void
printf
(
char
*
,
...);
class
Foo
{
public
:
Foo
(
int
n
)
:
n_
(
n
)
{
}
int
f
()
{
return
n_
;
}
int
badTest
();
int
goodTest
();
private
:
int
n_
;
};
int
Foo
::
badTest
()
{
try
{
throw
int
(
99
);
}
catch
(
int
&
i
)
{
n_
=
16
;
}
return
n_
;
// On the sparc, the return will use a ld [%l0],%i0 instruction.
// However %l0 was clobbered at the end of the catch block. It was
// used to do an indirect call.
}
int
Foo
::
goodTest
()
{
int
n
;
try
{
throw
int
(
99
);
}
catch
(
int
&
i
)
{
n
=
16
;
}
return
n_
;
// The return will use a ld [%l2],%i0 instruction. Since %l2
// contains the "this" pointer this works.
}
int
main
()
{
Foo
foo
(
5
);
foo
.
goodTest
();
foo
.
badTest
();
// the badTest will have failed
printf
(
"PASS
\n
"
);
}
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