Skip a number of C++ test cases for '-fno-exceptions' testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')
Checks
Commit Message
Hi!
On 2023-06-06T20:31:21+0100, Jonathan Wakely <jwakely@redhat.com> wrote:
> On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge <thomas@codesourcery.com> wrote:
>> This issue comes up in context of me working on C++ support for GCN and
>> nvptx target. Those targets shall default to '-fno-exceptions' -- or,
>> "in other words", '-fexceptions' is not supported. (Details omitted
>> here.)
>>
>> It did seem clear to me that with such a configuration it'll be hard to
>> get clean test results. Then I found code in
>> 'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-prune':
>>
>> # If exceptions are disabled, mark tests expecting exceptions to be enabled
>> # as unsupported.
>> if { ![check_effective_target_exceptions_enabled] } {
>> if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
>> return "::unsupported::exception handling disabled"
>> }
>>
>> ..., which, in a way, sounds as if the test suite generally is meant to
>> produce useful results for '-fno-exceptions', nice surprise!
>>
>> Running x86_64-pc-linux-gnu (not yet GCN, nvptx) 'make check' with:
>>
>> RUNTESTFLAGS='--target_board=unix/-fno-exceptions\{,-m32\}'
>>
>> ..., I find that indeed this does work for a lot of test cases, where we
>> then get (random example):
>>
>> PASS: g++.dg/coroutines/pr99710.C (test for errors, line 23)
>> -PASS: g++.dg/coroutines/pr99710.C (test for excess errors)
>> +UNSUPPORTED: g++.dg/coroutines/pr99710.C: exception handling disabled
>>
>> ..., due to:
>>
>> [...]/g++.dg/coroutines/pr99710.C: In function 'task my_coro()':
>> +[...]/g++.dg/coroutines/pr99710.C:18:10: error: exception handling
>> disabled, use '-fexceptions' to enable
>> [...]/g++.dg/coroutines/pr99710.C:23:7: error: await expressions are
>> not permitted in handlers
>> compiler exited with status 1
>>
>> But, we're nowhere near clean test results: PASS -> FAIL as well as
>> XFAIL -> XPASS regressions, due to 'error: exception handling disabled'
>> precluding other diagnostics seems to be one major issue.
>>
>> Is there interest in me producing the obvious (?) changes to those test
>> cases, such that compiler g++ as well as target library libstdc++ test
>> results are reasonably clean? (If you think that's all "wasted effort",
>> then I suppose I'll just locally ignore any FAILs/XPASSes/UNRESOLVEDs
>> that appear in combination with
>> 'UNSUPPORTED: [...]: exception handling disabled'.)
>
> I would welcome that for libstdc++. I do sometimes run the libstdc++ tests
> with "unusual" options, like -fno-exceptions and -fno-rtti (e.g. today I've
> been fixing FAILs that only happen with -fexcess-precision=standard). I
> just manually ignore the tests that fail for -fno-exceptions, but it would
> be great if they were automatically skipped as UNSUPPORTED.
Per your and my changes a few days ago, we've already got libstdc++
covered, with the sole exception of:
PASS: 27_io/basic_ostream/inserters_arithmetic/pod/23875.cc (test for excess errors)
[-PASS:-]{+FAIL:+} 27_io/basic_ostream/inserters_arithmetic/pod/23875.cc execution test
terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
(Low priority for me.)
Not having heard anything contrary regarding the compiler side of things,
I've now been working on that, see below.
> We already have a handful of tests that use #if __cpp_exceptions to make
> those parts conditional on exception support.
Yes, that's an option not for all but certainly for some test cases.
(I'm not looking into that now -- but this may in fact be a good
beginner-level task, will add to <https://gcc.gnu.org/wiki/EasyHacks>).
>> Otherwise, a number of test cases need DejaGnu directives
>> conditionalized on 'target exceptions_enabled'.
Before I get to such things, even simpler: OK to push the attached
"Skip a number of C++ test cases for '-fno-exceptions' testing"?
>> (Or,
>> 'error: exception handling disabled' made a "really late" diagnostic, so
>> that it doesn't preclude other diagnostics? I'll have a look. Well,
>> maybe something like: in fact do not default to '-fno-exceptions', but
>> instead emit 'error: exception handling disabled' only if in a "really
>> late" pass we run into exceptions-related constructs that we cannot
>> support. That'd also avoid PASS -> UNSUPPORTED "regressions" when
>> exception handling in fact gets optimized away, for example. I like that
>> idea, conceptually -- but is it feasible to implement..?)
>
> IMHO just [...] using [an effective target keyword] in test
> selectors seems simpler, and doesn't require changes to the compiler, just
> the tests.
I still like the idea, but yes, I've mentally put it on file "for later"
(ha, ha, ha...) -- it doesn't seem obvious to implement.
Grüße
Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
Comments
Hi!
GCC/C++ front end maintainers, please provide input on the overall
approach here:
On 2023-06-15T17:15:54+0200, I wrote:
> On 2023-06-06T20:31:21+0100, Jonathan Wakely <jwakely@redhat.com> wrote:
>> On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge <thomas@codesourcery.com> wrote:
>>> This issue comes up in context of me working on C++ support for GCN and
>>> nvptx target. Those targets shall default to '-fno-exceptions' -- or,
>>> "in other words", '-fexceptions' is not supported. (Details omitted
>>> here.)
>>>
>>> It did seem clear to me that with such a configuration it'll be hard to
>>> get clean test results. Then I found code in
>>> 'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-prune':
>>>
>>> # If exceptions are disabled, mark tests expecting exceptions to be enabled
>>> # as unsupported.
>>> if { ![check_effective_target_exceptions_enabled] } {
>>> if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
>>> return "::unsupported::exception handling disabled"
>>> }
>>>
>>> ..., which, in a way, sounds as if the test suite generally is meant to
>>> produce useful results for '-fno-exceptions', nice surprise!
>>>
>>> Running x86_64-pc-linux-gnu (not yet GCN, nvptx) 'make check' with:
>>>
>>> RUNTESTFLAGS='--target_board=unix/-fno-exceptions\{,-m32\}'
>>>
>>> ..., I find that indeed this does work for a lot of test cases, where we
>>> then get (random example):
>>>
>>> PASS: g++.dg/coroutines/pr99710.C (test for errors, line 23)
>>> -PASS: g++.dg/coroutines/pr99710.C (test for excess errors)
>>> +UNSUPPORTED: g++.dg/coroutines/pr99710.C: exception handling disabled
>>>
>>> ..., due to:
>>>
>>> [...]/g++.dg/coroutines/pr99710.C: In function 'task my_coro()':
>>> +[...]/g++.dg/coroutines/pr99710.C:18:10: error: exception handling disabled, use '-fexceptions' to enable
>>> [...]/g++.dg/coroutines/pr99710.C:23:7: error: await expressions are not permitted in handlers
>>> compiler exited with status 1
>>>
>>> But, we're nowhere near clean test results: PASS -> FAIL as well as
>>> XFAIL -> XPASS regressions, due to 'error: exception handling disabled'
>>> precluding other diagnostics seems to be one major issue.
>>>
>>> Is there interest in me producing the obvious (?) changes to those test
>>> cases, such that compiler g++ as well as target library libstdc++ test
>>> results are reasonably clean? (If you think that's all "wasted effort",
>>> then I suppose I'll just locally ignore any FAILs/XPASSes/UNRESOLVEDs
>>> that appear in combination with
>>> 'UNSUPPORTED: [...]: exception handling disabled'.)
>>
>> I would welcome that for libstdc++. [...]
> Per your and my changes a few days ago, we've already got libstdc++
> covered, [...]
> Not having heard anything contrary regarding the compiler side of things,
> I've now been working on that, see below.
>
>> We already have a handful of tests that use #if __cpp_exceptions to make
>> those parts conditional on exception support.
>
> Yes, that's an option not for all but certainly for some test cases.
> (I'm not looking into that now -- but this may in fact be a good
> beginner-level task, will add to <https://gcc.gnu.org/wiki/EasyHacks>).
>
>>> Otherwise, a number of test cases need DejaGnu directives
>>> conditionalized on 'target exceptions_enabled'.
>
> Before I get to such things, even simpler: OK to push the attached
> "Skip a number of C++ test cases for '-fno-exceptions' testing"?
I've re-attached my patch from a few months ago:
"Skip a number of C++ test cases for '-fno-exceptions' testing".
(I'd obviously re-check for current master branch before 'git push'.)
If there is interest in this at all, I'd then later complete and submit
my more or less WIP patches for the slightly more involved test case
scenarios.
Grüße
Thomas
>>> (Or,
>>> 'error: exception handling disabled' made a "really late" diagnostic, so
>>> that it doesn't preclude other diagnostics? I'll have a look. Well,
>>> maybe something like: in fact do not default to '-fno-exceptions', but
>>> instead emit 'error: exception handling disabled' only if in a "really
>>> late" pass we run into exceptions-related constructs that we cannot
>>> support. That'd also avoid PASS -> UNSUPPORTED "regressions" when
>>> exception handling in fact gets optimized away, for example. I like that
>>> idea, conceptually -- but is it feasible to implement..?)
>>
>> IMHO just [...] using [an effective target keyword] in test
>> selectors seems simpler, and doesn't require changes to the compiler, just
>> the tests.
>
> I still like the idea, but yes, I've mentally put it on file "for later"
> (ha, ha, ha...) -- it doesn't seem obvious to implement.
>
>
> Grüße
> Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
From fb7847774109c47708bc0fe26270d89a0db8ae0b Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 7 Jun 2023 14:14:44 +0200
Subject: [PATCH] Skip a number of C++ test cases for '-fno-exceptions' testing
Running 'make check' with: 'RUNTESTFLAGS=--target_board=unix/-fno-exceptions',
'error: exception handling disabled' is triggered for C++ 'throw' etc. usage,
and per 'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-prune':
# If exceptions are disabled, mark tests expecting exceptions to be enabled
# as unsupported.
if { ![check_effective_target_exceptions_enabled] } {
if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
return "::unsupported::exception handling disabled"
}
..., which generally means:
-PASS: [...] (test for excess errors)
+UNSUPPORTED: [...]: exception handling disabled
However, if there are additional 'dg-error' etc. directives, these may regress
PASS -> FAIL (or similar) -- if their associated diagnostics are precluded by
'error: exception handling disabled'. For example:
PASS: g++.dg/cpp2a/explicit1.C (test for errors, line 43)
PASS: g++.dg/cpp2a/explicit1.C (test for errors, line 47)
[-PASS:-]{+FAIL:+} g++.dg/cpp2a/explicit1.C (test for errors, line 50)
[-PASS:-]{+FAIL:+} g++.dg/cpp2a/explicit1.C (test for errors, line 51)
PASS: g++.dg/cpp2a/explicit1.C (test for errors, line 52)
PASS: g++.dg/cpp2a/explicit1.C (test for errors, line 53)
PASS: g++.dg/cpp2a/explicit1.C (test for errors, line 59)
[-PASS:-]{+UNSUPPORTED:+} g++.dg/cpp2a/explicit1.C [-(test for excess errors)-]{+: exception handling disabled+}
Specify 'dg-require-effective-target exceptions_enabled' for those test cases.
gcc/testsuite/
* g++.dg/coroutines/pr95616-0.C: Specify
'dg-require-effective-target exceptions_enabled'.
* g++.dg/coroutines/pr95616-1.C: Likewise.
* g++.dg/coroutines/pr95616-2.C: Likewise.
* g++.dg/coroutines/pr95616-3.C: Likewise.
* g++.dg/coroutines/pr95616-4.C: Likewise.
* g++.dg/coroutines/pr95616-5.C: Likewise.
* g++.dg/coroutines/pr95616-6.C: Likewise.
* g++.dg/cpp0x/catch1.C: Likewise.
* g++.dg/cpp0x/constexpr-throw.C: Likewise.
* g++.dg/cpp1y/constexpr-89785-2.C: Likewise.
* g++.dg/cpp1y/constexpr-throw.C: Likewise.
* g++.dg/cpp1y/pr79393-3.C: Likewise.
* g++.dg/cpp2a/consteval-memfn1.C: Likewise.
* g++.dg/cpp2a/consteval11.C: Likewise.
* g++.dg/cpp2a/consteval9.C: Likewise.
* g++.dg/cpp2a/explicit1.C: Likewise.
* g++.dg/cpp2a/explicit2.C: Likewise.
* g++.dg/cpp2a/explicit5.C: Likewise.
* g++.dg/eh/builtin10.C: Likewise.
* g++.dg/eh/builtin11.C: Likewise.
* g++.dg/eh/builtin6.C: Likewise.
* g++.dg/eh/builtin7.C: Likewise.
* g++.dg/eh/builtin9.C: Likewise.
* g++.dg/eh/dtor4.C: Likewise.
* g++.dg/eh/pr42859.C: Likewise.
* g++.dg/ext/stmtexpr25.C: Likewise.
* g++.dg/ext/vla4.C: Likewise.
* g++.dg/init/placement4.C: Likewise.
* g++.dg/other/error32.C: Likewise.
* g++.dg/parse/crash55.C: Likewise.
* g++.dg/parse/pr31952-2.C: Likewise.
* g++.dg/parse/pr31952-3.C: Likewise.
* g++.dg/tm/noexcept-7.C: Likewise.
* g++.dg/torture/pr43257.C: Likewise.
* g++.dg/torture/pr56694.C: Likewise.
* g++.dg/torture/pr81659.C: Likewise.
* g++.dg/warn/Wcatch-value-1.C: Likewise.
* g++.dg/warn/Wcatch-value-2.C: Likewise.
* g++.dg/warn/Wcatch-value-3.C: Likewise.
* g++.dg/warn/Wcatch-value-3b.C: Likewise.
* g++.dg/warn/Wexceptions1.C: Likewise.
* g++.dg/warn/Wexceptions3.C: Likewise.
* g++.dg/warn/Winfinite-recursion-3.C: Likewise.
* g++.dg/warn/Wreturn-6.C: Likewise.
* g++.dg/warn/Wstringop-truncation-2.C: Likewise.
* g++.dg/warn/Wterminate1.C: Likewise.
* g++.old-deja/g++.eh/catch1.C: Likewise.
* g++.old-deja/g++.eh/catch10.C: Likewise.
* g++.old-deja/g++.eh/cond1.C: Likewise.
* g++.old-deja/g++.eh/ctor1.C: Likewise.
* g++.old-deja/g++.eh/throw2.C: Likewise.
* g++.old-deja/g++.other/cond5.C: Likewise.
---
gcc/testsuite/g++.dg/coroutines/pr95616-0.C | 1 +
gcc/testsuite/g++.dg/coroutines/pr95616-1.C | 1 +
gcc/testsuite/g++.dg/coroutines/pr95616-2.C | 1 +
gcc/testsuite/g++.dg/coroutines/pr95616-3.C | 1 +
gcc/testsuite/g++.dg/coroutines/pr95616-4.C | 1 +
gcc/testsuite/g++.dg/coroutines/pr95616-5.C | 1 +
gcc/testsuite/g++.dg/coroutines/pr95616-6.C | 1 +
gcc/testsuite/g++.dg/cpp0x/catch1.C | 1 +
gcc/testsuite/g++.dg/cpp0x/constexpr-throw.C | 1 +
gcc/testsuite/g++.dg/cpp1y/constexpr-89785-2.C | 1 +
gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C | 1 +
gcc/testsuite/g++.dg/cpp1y/pr79393-3.C | 1 +
gcc/testsuite/g++.dg/cpp2a/consteval-memfn1.C | 1 +
gcc/testsuite/g++.dg/cpp2a/consteval11.C | 1 +
gcc/testsuite/g++.dg/cpp2a/consteval9.C | 1 +
gcc/testsuite/g++.dg/cpp2a/explicit1.C | 1 +
gcc/testsuite/g++.dg/cpp2a/explicit2.C | 1 +
gcc/testsuite/g++.dg/cpp2a/explicit5.C | 1 +
gcc/testsuite/g++.dg/eh/builtin10.C | 1 +
gcc/testsuite/g++.dg/eh/builtin11.C | 1 +
gcc/testsuite/g++.dg/eh/builtin6.C | 1 +
gcc/testsuite/g++.dg/eh/builtin7.C | 1 +
gcc/testsuite/g++.dg/eh/builtin9.C | 1 +
gcc/testsuite/g++.dg/eh/dtor4.C | 2 ++
gcc/testsuite/g++.dg/eh/pr42859.C | 1 +
gcc/testsuite/g++.dg/ext/stmtexpr25.C | 1 +
gcc/testsuite/g++.dg/ext/vla4.C | 1 +
gcc/testsuite/g++.dg/init/placement4.C | 2 ++
gcc/testsuite/g++.dg/other/error32.C | 1 +
gcc/testsuite/g++.dg/parse/crash55.C | 2 ++
gcc/testsuite/g++.dg/parse/pr31952-2.C | 2 ++
gcc/testsuite/g++.dg/parse/pr31952-3.C | 2 ++
gcc/testsuite/g++.dg/tm/noexcept-7.C | 1 +
gcc/testsuite/g++.dg/torture/pr43257.C | 1 +
gcc/testsuite/g++.dg/torture/pr56694.C | 1 +
gcc/testsuite/g++.dg/torture/pr81659.C | 1 +
gcc/testsuite/g++.dg/warn/Wcatch-value-1.C | 1 +
gcc/testsuite/g++.dg/warn/Wcatch-value-2.C | 1 +
gcc/testsuite/g++.dg/warn/Wcatch-value-3.C | 1 +
gcc/testsuite/g++.dg/warn/Wcatch-value-3b.C | 1 +
gcc/testsuite/g++.dg/warn/Wexceptions1.C | 2 ++
gcc/testsuite/g++.dg/warn/Wexceptions3.C | 2 ++
gcc/testsuite/g++.dg/warn/Winfinite-recursion-3.C | 1 +
gcc/testsuite/g++.dg/warn/Wreturn-6.C | 2 ++
gcc/testsuite/g++.dg/warn/Wstringop-truncation-2.C | 1 +
gcc/testsuite/g++.dg/warn/Wterminate1.C | 1 +
gcc/testsuite/g++.old-deja/g++.eh/catch1.C | 1 +
gcc/testsuite/g++.old-deja/g++.eh/catch10.C | 1 +
gcc/testsuite/g++.old-deja/g++.eh/cond1.C | 1 +
gcc/testsuite/g++.old-deja/g++.eh/ctor1.C | 2 ++
gcc/testsuite/g++.old-deja/g++.eh/throw2.C | 1 +
gcc/testsuite/g++.old-deja/g++.other/cond5.C | 1 +
52 files changed, 61 insertions(+)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-additional-options "-fsyntax-only" }
#if __has_include(<coroutine>)
@@ -1,5 +1,6 @@
// PR c++/53371
// { dg-do compile { target c++11 } }
+// { dg-require-effective-target exceptions_enabled }
struct Abs
{
@@ -1,4 +1,5 @@
// { dg-do compile { target c++11 } }
+// { dg-require-effective-target exceptions_enabled }
constexpr int may_throw(bool decide) {
return decide ? 42 : throw -1; // { dg-error "throw" }
@@ -1,5 +1,6 @@
// PR c++/89785
// { dg-do compile { target c++14 } }
+// { dg-require-effective-target exceptions_enabled }
constexpr int
foo (int x)
@@ -1,4 +1,5 @@
// { dg-do compile { target c++14 } }
+// { dg-require-effective-target exceptions_enabled }
constexpr void f1() {
if (false)
@@ -1,5 +1,6 @@
// pr c++/79393
// { dg-do compile { target c++14 } }
+// { dg-require-effective-target exceptions_enabled }
struct A
{
@@ -1,5 +1,6 @@
// PR c++/99895
// { dg-do compile { target c++20 } }
+// { dg-require-effective-target exceptions_enabled }
struct fixed_string {
consteval int size(int n) const {
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-std=c++2a" }
consteval int bar (int i) { if (i != 1) throw 1; return 0; } // { dg-error "is not a constant expression" }
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-std=c++2a" }
consteval int bar (int i) { if (i != 1) throw 1; return 0; } // { dg-error "is not a constant expression" }
@@ -1,5 +1,6 @@
// P0892R2
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-std=c++2a" }
constexpr int fn0 () { return 0; }
@@ -1,5 +1,6 @@
// P0892R2
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-std=c++2a" }
int foo() { return 42; }
@@ -1,5 +1,6 @@
// P0892R2
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-std=c++2a" }
constexpr int fn0 () { return 0; }
@@ -1,5 +1,6 @@
// PR c++/88482
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
extern "C" void __cxa_throw (void *, void *, void (*) (void *));
extern "C" float __cxa_get_exception_ptr (void *) throw (); // { dg-message "previous declaration" }
@@ -1,5 +1,6 @@
// PR c++/88482
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
extern "C" void __cxa_throw (float, void *, void (*) (void *)); // { dg-message "previous declaration" }
extern "C" void *__cxa_get_exception_ptr (void *) throw ();
@@ -1,5 +1,6 @@
// PR c++/88482
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
float __cxa_throw; // { dg-message "previous declaration" }
extern "C" void *__cxa_get_exception_ptr (void *);
@@ -1,5 +1,6 @@
// PR c++/88482
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
extern "C" void __cxa_throw (void *, void *, void (*) (void *));
int __cxa_get_exception_ptr; // { dg-message "previous declaration" }
@@ -1,5 +1,6 @@
// PR c++/88482
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
extern "C" int __cxa_throw (void *, void *, void (*) (void *)); // { dg-message "previous declaration" }
extern "C" void *__cxa_get_exception_ptr (void *) throw ();
@@ -1,5 +1,7 @@
// PR c++/109172
+// { dg-require-effective-target exceptions_enabled }
+
class Demo
{
~Demo();
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
void start (void);
void
@@ -1,6 +1,7 @@
// PR c++/81073
// { dg-options "" }
// { dg-do compile { target c++11 } }
+// { dg-require-effective-target exceptions_enabled }
struct test { const int *addr; };
@@ -1,4 +1,5 @@
// PR c++/29318
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "" }
#include <typeinfo>
@@ -1,5 +1,7 @@
// PR c++/34158
+// { dg-require-effective-target exceptions_enabled }
+
typedef __SIZE_TYPE__ size_t;
extern "C" void* malloc (size_t);
extern "C" void free (void *);
@@ -1,4 +1,5 @@
// PR c++/33492
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "" }
void foo()
@@ -1,5 +1,7 @@
// PR c++/42038
+// { dg-require-effective-target exceptions_enabled }
+
extern int __cxa_begin_catch; // { dg-message "previous declaration" }
void f(void)
@@ -1,5 +1,7 @@
// PR c++/31952
+// { dg-require-effective-target exceptions_enabled }
+
void
f0()
{
@@ -1,5 +1,7 @@
// PR c++/31952
+// { dg-require-effective-target exceptions_enabled }
+
int
f0 (int bar) // { dg-message "previously" }
try
@@ -1,4 +1,5 @@
// FIXME the TS says atomic_noexcept calls abort, not terminate.
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-fgnu-tm" }
void f()
@@ -1,4 +1,5 @@
/* { dg-do assemble } */
+/* { dg-require-effective-target exceptions_enabled } */
class A {};
class B {};
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-fopenmp" }
// { dg-require-effective-target fopenmp }
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
void
a (int b)
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-Wcatch-value=1" }
struct A { virtual ~A() {} };
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-Wcatch-value=2" }
struct A { virtual ~A() {} };
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-Wcatch-value=3" }
struct A { virtual ~A() {} };
@@ -1,3 +1,4 @@
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-Wcatch-value=3" }
struct A { virtual ~A() {} };
@@ -1,5 +1,7 @@
// PR c++/97675
+// { dg-require-effective-target exceptions_enabled }
+
struct Base { };
struct Child : Base { };
int main() {
@@ -1,5 +1,7 @@
// PR c++/81660
+// { dg-require-effective-target exceptions_enabled }
+
void bar (int);
void
@@ -1,5 +1,6 @@
/* PR middle-end/88232 - Please implement -Winfinite-recursion
{ dg-do compile }
+ { dg-require-effective-target exceptions_enabled }
{ dg-options "-Wall -Winfinite-recursion" } */
typedef __SIZE_TYPE__ size_t;
@@ -1,5 +1,7 @@
// PR c++/107310
+// { dg-require-effective-target exceptions_enabled }
+
struct f
{
~f();
@@ -3,6 +3,7 @@
// Compile with -g to verify the warning deals properly with debug
// statements.
// { dg-do compile }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-O2 -Wstringop-truncation -g" }
extern "C" char* strncpy (char*, const char*, __SIZE_TYPE__);
@@ -1,6 +1,7 @@
// In C++98 mode this gets a -Wc++11-compat warning, in C++11 mode a
// -Wterminate warning.
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-Wall" }
struct A
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-require-effective-target exceptions_enabled }
//
// Copyright (C) 1999 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 6 Jun 1999 <nathan@acm.org>
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-require-effective-target exceptions_enabled }
// Test that we notice unfortunate handler ordering.
struct A { };
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-require-effective-target exceptions_enabled }
// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 11 Apr 1999 <nathan@acm.org>
@@ -1,4 +1,6 @@
// { dg-do assemble }
+// { dg-require-effective-target exceptions_enabled }
+
struct A
{
A();
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-require-effective-target exceptions_enabled }
// Submitted by Sebastian Ritterbusch <uabp@rz.uni-karlsruhe.de>
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-require-effective-target exceptions_enabled }
// { dg-options "-W -pedantic -ansi" }
// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
--
2.34.1