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
1acc3340
Commit
1acc3340
authored
Jul 25, 2012
by
Janis Johnson
Committed by
Janis Johnson
Jul 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* g++.dg/cpp0x/nullptr21.c: Remove printfs, make self-checking.
From-SVN: r189870
parent
b0c724c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
15 deletions
+30
-15
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/cpp0x/nullptr21.C
+26
-15
No files found.
gcc/testsuite/ChangeLog
View file @
1acc3340
2012-07-25 Janis Johnson <janisjo@codesourcery.com>
* g++.dg/cpp0x/nullptr21.c: Remove printfs, make self-checking.
2012-07-25 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/noreturn5.ad[sb]: New test.
...
...
gcc/testsuite/g++.dg/cpp0x/nullptr21.C
View file @
1acc3340
...
...
@@ -3,42 +3,53 @@
// Test throw and catch
#include <cstdio>
extern
"C"
void
abort
(
void
);
typedef
decltype
(
nullptr
)
nullptr_t
;
int
result
[
2
];
void
__attribute__
((
noinline
))
foo
(
int
i
,
int
j
)
{
result
[
i
]
=
j
;
}
int
main
()
{
try
{
throw
nullptr
;
}
catch
(
void
*
)
{
printf
(
"Test 1 Fail"
);
foo
(
0
,
1
);
}
catch
(
bool
)
{
printf
(
"Test 1 Fail"
);
foo
(
0
,
2
);
}
catch
(
int
)
{
printf
(
"Test 1 Fail"
);
foo
(
0
,
3
);
}
catch
(
long
int
)
{
printf
(
"Test 1 Fail"
);
foo
(
0
,
4
);
}
catch
(
nullptr_t
)
{
printf
(
"Test 1 OK"
);
foo
(
0
,
5
);
}
catch
(...)
{
printf
(
"Test 1 Fail"
);
}
// { dg-output "Test 1 OK" }
foo
(
0
,
6
);
}
nullptr_t
mynull
=
0
;
try
{
throw
mynull
;
}
catch
(
void
*
)
{
printf
(
"Test 2 Fail"
);
foo
(
1
,
1
);
}
catch
(
bool
)
{
printf
(
"Test 2 Fail"
);
foo
(
1
,
2
);
}
catch
(
int
)
{
printf
(
"Test 2 Fail"
);
foo
(
1
,
3
);
}
catch
(
long
int
)
{
printf
(
"Test 2 Fail"
);
foo
(
1
,
4
);
}
catch
(
nullptr_t
)
{
printf
(
"Test 2 OK"
);
foo
(
1
,
5
);
}
catch
(...)
{
printf
(
"Test 2 Fail"
);
}
// { dg-output "Test 2 OK" }
foo
(
1
,
6
);
}
if
(
result
[
0
]
!=
5
||
result
[
1
]
!=
5
)
abort
();
}
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