Re: Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')
On Wed, 7 Jun 2023 at 12:51, Jonathan Wakely wrote: > > > On Wed, 7 Jun 2023 at 10:08, Thomas Schwinge > wrote: > >> Hi! >> >> On 2023-06-07T09:12:31+0100, Jonathan Wakely wrote: >> > On Wed, 7 Jun 2023 at 08:13, Thomas Schwinge wrote: >> >> On 2023-06-06T20:31:21+0100, Jonathan Wakely >> wrote: >> >> > On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge < >> [email protected]> >> >> > 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++. >> >> >> >> Assuming no issues found in testing, OK to push the attached >> >> "Support 'UNSUPPORTED: [...]: exception handling disabled' for >> libstdc++ >> >> testing"? >> >> (Thanks, Jozef!) >> > >> > Yes please. >> >> Pushed commit r14-1604-g5faaabef3819434d13fcbf749bd07bfc98ca7c3c >> "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ >> testing" >> to master branch, as posted. >> >> For one-week-old GCC commit 2720bbd597f56742a17119dfe80edc2ba86af255, >> x86_64-pc-linux-gnu, I see no changes without '-fno-exceptions' (as >> expected), and otherwise: >> >> === libstdc++ Summary for >> [-unix-]{+unix/-fno-exceptions+} === >> >> # of expected passes[-15044-]{+12877+} >> # of unexpected failures[-5-]{+10+} >> # of expected failures [-106-]{+77+} >> {+# of unresolved testcases 6+} >> # of unsupported tests [-747-]{+1846+} >> >> As expected, there's a good number of (random example): >> >> -PASS: 18_support/105387.cc (test for excess errors) >> -PASS: 18_support/105387.cc execution test >> +UNSUPPORTED: 18_support/105387.cc: exception handling disabled >> >> ..., plus the following: >> >> [-PASS:-]{+FAIL:+} 23_containers/vector/capacity/constexpr.cc (test >> for excess errors) >> >> >> [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101: >> error: non-constant condition for static assertion >> In file included from >> [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:6: >> >> [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101: >> in 'constexpr' expansion of 'test_shrink_to_fit()' >> [...]/libstdc++-v3/testsuite/util/testsuite_hooks.h:56: error: >> '__builtin_fprintf(stderr, ((const char*)"%s:%d: %s: Assertion \'%s\' >> failed.\012"), ((con
Re: Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')
On Wed, 7 Jun 2023 at 10:08, Thomas Schwinge
wrote:
> Hi!
>
> On 2023-06-07T09:12:31+0100, Jonathan Wakely wrote:
> > On Wed, 7 Jun 2023 at 08:13, Thomas Schwinge wrote:
> >> On 2023-06-06T20:31:21+0100, Jonathan Wakely
> wrote:
> >> > On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge >
> >> > 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++.
> >>
> >> Assuming no issues found in testing, OK to push the attached
> >> "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++
> >> testing"?
> >> (Thanks, Jozef!)
> >
> > Yes please.
>
> Pushed commit r14-1604-g5faaabef3819434d13fcbf749bd07bfc98ca7c3c
> "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++
> testing"
> to master branch, as posted.
>
> For one-week-old GCC commit 2720bbd597f56742a17119dfe80edc2ba86af255,
> x86_64-pc-linux-gnu, I see no changes without '-fno-exceptions' (as
> expected), and otherwise:
>
> === libstdc++ Summary for
> [-unix-]{+unix/-fno-exceptions+} ===
>
> # of expected passes[-15044-]{+12877+}
> # of unexpected failures[-5-]{+10+}
> # of expected failures [-106-]{+77+}
> {+# of unresolved testcases 6+}
> # of unsupported tests [-747-]{+1846+}
>
> As expected, there's a good number of (random example):
>
> -PASS: 18_support/105387.cc (test for excess errors)
> -PASS: 18_support/105387.cc execution test
> +UNSUPPORTED: 18_support/105387.cc: exception handling disabled
>
> ..., plus the following:
>
> [-PASS:-]{+FAIL:+} 23_containers/vector/capacity/constexpr.cc (test
> for excess errors)
>
>
> [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101:
> error: non-constant condition for static assertion
> In file included from
> [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:6:
>
> [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101:
> in 'constexpr' expansion of 'test_shrink_to_fit()'
> [...]/libstdc++-v3/testsuite/util/testsuite_hooks.h:56: error:
> '__builtin_fprintf(stderr, ((const char*)"%s:%d: %s: Assertion \'%s\'
> failed.\012"), ((const
> char*)"[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc"),
> 92, ((const char*)"constexpr bool test_shrink_to_fit()"), ((const
> char*)"v.capacity() == 0"))' is not a constant expression
> [...
Re: Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')
Hi!
On 2023-06-07T09:12:31+0100, Jonathan Wakely wrote:
> On Wed, 7 Jun 2023 at 08:13, Thomas Schwinge wrote:
>> On 2023-06-06T20:31:21+0100, Jonathan Wakely wrote:
>> > On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge
>> > 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++.
>>
>> Assuming no issues found in testing, OK to push the attached
>> "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++
>> testing"?
>> (Thanks, Jozef!)
>
> Yes please.
Pushed commit r14-1604-g5faaabef3819434d13fcbf749bd07bfc98ca7c3c
"Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++
testing"
to master branch, as posted.
For one-week-old GCC commit 2720bbd597f56742a17119dfe80edc2ba86af255,
x86_64-pc-linux-gnu, I see no changes without '-fno-exceptions' (as
expected), and otherwise:
=== libstdc++ Summary for [-unix-]{+unix/-fno-exceptions+}
===
# of expected passes[-15044-]{+12877+}
# of unexpected failures[-5-]{+10+}
# of expected failures [-106-]{+77+}
{+# of unresolved testcases 6+}
# of unsupported tests [-747-]{+1846+}
As expected, there's a good number of (random example):
-PASS: 18_support/105387.cc (test for excess errors)
-PASS: 18_support/105387.cc execution test
+UNSUPPORTED: 18_support/105387.cc: exception handling disabled
..., plus the following:
[-PASS:-]{+FAIL:+} 23_containers/vector/capacity/constexpr.cc (test for
excess errors)
[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101:
error: non-constant condition for static assertion
In file included from
[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:6:
[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101:
in 'constexpr' expansion of 'test_shrink_to_fit()'
[...]/libstdc++-v3/testsuite/util/testsuite_hooks.h:56: error:
'__builtin_fprintf(stderr, ((const char*)"%s:%d: %s: Assertion \'%s\'
failed.\012"), ((const
char*)"[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc"),
92, ((const char*)"constexpr bool test_shrink_to_fit()"), ((const
char*)"v.capacity() == 0"))' is not a constant expression
[...]/libstdc++-v3/testsuite/util/testsuite_hooks.h:66: note: in expansion
of macro '_VERIFY_PRINT'
[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:92:
note: in expansion of macro 'VERIFY'
compiler exited with status 1
..., and:
PASS: 23_cont
Re: Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')
On Wed, 7 Jun 2023 at 08:13, Thomas Schwinge wrote:
> Hi!
>
> On 2023-06-06T20:31:21+0100, Jonathan Wakely wrote:
> > On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge
> > 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++.
>
> Assuming no issues found in testing, OK to push the attached
> "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++
> testing"?
> (Thanks, Jozef!)
>
Yes please.
>
> > 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.
> >
> > We already have a handful of tests that use #if __cpp_exceptions to make
> > those parts conditional on exception support. We also have exactly one
> test
> > that is currently UNSUPPORTED when -fno-exceptions is used:
> > testsuite/18_support/nested_exception/rethrow_if_nested-term.cc:// {
> > dg-skip-if "" { *-*-* } { "-fno-exceptions" } }
>
> ACK -- that'll only work for explicit '-fno-exceptions', but not for
> implicit (say, via 'CC1PLUS_SPEC'), right?
That's right.
> So, indeed:
>
> > That could be changed to use an effective target keyword instead.
>
> I'll look into that later.
>
> > To add an effective-target to the libstdc++ testsuite would be as simple
> as:
> >
> > --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> > +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> > @@ -1421,6 +1421,14 @@ proc check_effective_target_tzdb { } {
> > }]
> > }
> >
> > +# Return 1 if exception handling is enabled.
> > +proc check_effective_target_exceptions_enabled { } {
> > +return [check_v3_target_prop_cached et_eh {
> > + set cond "defined __cpp_exceptions"
> > + return [v3_check_preprocessor_condition eh $cond]
> > +}]
> > +}
> > +
>
> Well, we don't even need to do that, because:
>
> > However, you probably want to add it to the main testsuite instead, which
> > would be a little more involved (the v3_check_preprocessor_condition proc
> > is specific to libstdc++).
>
> ..., this has already been done in Subversion r279246
> (Git commit a9046e9853024206bec092dd63e21e152cb5cbca)
> "[MSP430] -Add fno-exceptions multilib" (thanks, Jozef!):
>
Nice.
>
> --- gcc/testsuite/lib/target-supports.exp
> +++ gcc/testsuite/lib/target-supports.exp
> @@ -8990,6 +8990,24 @@ proc check_effective_target_exceptions {} {
> return 1
> }
>
> +# Use
Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')
Hi!
On 2023-06-06T20:31:21+0100, Jonathan Wakely wrote:
> On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge
> 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++.
Assuming no issues found in testing, OK to push the attached
"Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++
testing"?
(Thanks, Jozef!)
> 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.
>
> We already have a handful of tests that use #if __cpp_exceptions to make
> those parts conditional on exception support. We also have exactly one test
> that is currently UNSUPPORTED when -fno-exceptions is used:
> testsuite/18_support/nested_exception/rethrow_if_nested-term.cc:// {
> dg-skip-if "" { *-*-* } { "-fno-exceptions" } }
ACK -- that'll only work for explicit '-fno-exceptions', but not for
implicit (say, via 'CC1PLUS_SPEC'), right? So, indeed:
> That could be changed to use an effective target keyword instead.
I'll look into that later.
> To add an effective-target to the libstdc++ testsuite would be as simple as:
>
> --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> @@ -1421,6 +1421,14 @@ proc check_effective_target_tzdb { } {
> }]
> }
>
> +# Return 1 if exception handling is enabled.
> +proc check_effective_target_exceptions_enabled { } {
> +return [check_v3_target_prop_cached et_eh {
> + set cond "defined __cpp_exceptions"
> + return [v3_check_preprocessor_condition eh $cond]
> +}]
> +}
> +
Well, we don't even need to do that, because:
> However, you probably want to add it to the main testsuite instead, which
> would be a little more involved (the v3_check_preprocessor_condition proc
> is specific to libstdc++).
..., this has already been done in Subversion r279246
(Git commit a9046e9853024206bec092dd63e21e152cb5cbca)
"[MSP430] -Add fno-exceptions multilib" (thanks, Jozef!):
--- gcc/testsuite/lib/target-supports.exp
+++ gcc/testsuite/lib/target-supports.exp
@@ -8990,6 +8990,24 @@ proc check_effective_target_exceptions {} {
return 1
}
+# Used to check if the testing configuration supports exceptions.
+# Returns 0 if exceptions are unsupported or disabled (e.g. by passing
+# -fno-exceptions). Returns 1 if exceptions are enabled.
+proc check_effective_target_exceptions_enabled {} {
+return [check_cached_effective_target exceptions_enabled {
+ if
