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
96e1d96c
Commit
96e1d96c
authored
Apr 10, 2000
by
Nathan Sidwell
Committed by
Nathan Sidwell
Apr 10, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* g++.old-deja/g++.eh/catchptr1.C: New test.
From-SVN: r33062
parent
6d61f400
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
238 additions
and
0 deletions
+238
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.old-deja/g++.eh/catchptr1.C
+234
-0
No files found.
gcc/testsuite/ChangeLog
View file @
96e1d96c
2000-04-10 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.eh/catchptr1.C: New test.
2000-04-09 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.abi/cxa_vec.C: New test.
...
...
gcc/testsuite/g++.old-deja/g++.eh/catchptr1.C
0 → 100644
View file @
96e1d96c
// Test pointer chain catching
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Apr 2000 <nathan@nathan@codesourcery.com>
#include <stdio.h>
void
fn
()
{};
struct
A
{
void
fn
()
{}};
static
int
var
=
1
;
static
const
int
const_var
=
2
;
struct
B
;
struct
C
;
int
test0
()
{
try
{
throw
&
fn
;
}
catch
(
void
*
)
{
// should not decay to void *
return
1
;
}
catch
(...)
{
return
0
;
}
}
int
test1
()
{
try
{
throw
&
A
::
fn
;
}
catch
(
void
*
)
{
// should not decay to void *
return
1
;
}
catch
(...)
{
return
0
;
}
}
int
test2
()
{
try
{
throw
&
var
;
}
catch
(
void
*
)
{
// should decay to void *
return
0
;
}
catch
(...)
{
return
1
;
}
}
int
test3
()
{
try
{
throw
&
var
;
}
catch
(
void
const
*
)
{
// should decay to const void *
return
0
;
}
catch
(...)
{
return
1
;
}
}
int
test4
()
{
try
{
throw
&
const_var
;
}
catch
(
void
*
)
{
// should not decay to void *
return
1
;
}
catch
(
void
const
*
)
{
// should decay to const void *
return
0
;
}
catch
(...)
{
return
2
;
}
}
int
test5
()
{
try
{
throw
(
void
***
)
0
;
}
catch
(
void
***
)
{
return
0
;
}
catch
(...)
{
return
1
;
}
}
int
test6
()
{
try
{
throw
(
void
const
*
const
*
const
*
)
0
;
}
catch
(
void
***
)
{
return
1
;
}
catch
(
void
*
const
*
const
*
)
{
return
2
;
}
catch
(
void
const
*
*
const
*
)
{
return
3
;
}
catch
(
void
const
*
const
*
*
)
{
return
4
;
}
catch
(
void
const
*
const
*
const
*
)
{
return
0
;
}
catch
(...)
{
return
1
;
}
}
int
test7
()
{
try
{
throw
(
void
***
)
0
;
}
catch
(
void
const
*
const
**
)
{
return
1
;
}
catch
(
void
const
**
const
*
)
{
return
2
;
}
catch
(
void
*
const
*
const
*
)
{
return
0
;
}
catch
(...)
{
return
3
;
}
}
#if 0
int test8 ()
{
try
{
throw (B **)0;
}
catch (C **)
{
return 1;
}
catch (B **)
{
return 0;
}
catch (...)
{
return 2;
}
}
#endif
static
int
(
*
tests
[])()
=
{
test0
,
test1
,
test2
,
test3
,
test4
,
test5
,
test6
,
test7
,
#if 0
test8,
#endif
NULL
};
int
main
()
{
int
ix
;
int
errors
=
0
;
for
(
ix
=
0
;
tests
[
ix
];
ix
++
)
{
int
n
=
tests
[
ix
]
();
if
(
n
)
{
printf
(
"test %d failed %d
\n
"
,
ix
,
n
);
errors
++
;
}
}
return
errors
;
}
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