From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id A7A5E3858031 for ; Thu, 15 Jun 2023 15:48:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A7A5E3858031 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.00,245,1681200000"; d="scan'208,223";a="8894383" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 15 Jun 2023 07:48:07 -0800 IronPort-SDR: pe7lRguGv19mDYDWkxYSErHU4WtWyG1h3D0QgHZxiy/heAyJs9zl2AB9N5JOSDvdI90MldtI4y Gkq7vVCjJuz6Pr0ht2vTKlNzM3JJWv5PXJVYwtz4MbJh9HABnWW0QQzadXxs87RDM2CiCPiuEa KTzvHhzDyQoJ6t8njDy2YMFJ7yOiXhwfGepHYh7yM/2whh9VTVV1WpwdXjPzvyAFAycnqmFxXg tdRzwOwmDnuVZYNN0UWoSm0dfCZH7VfoS6pCDM5bafU8fWOHXUmpQ9Vzp4FQkp/BEizsjd3Jsl MSM= From: Thomas Schwinge To: , Jason Merrill , "Nathan Sidwell" CC: Jonathan Wakely Subject: Skip a number of C++ "split files" test cases for '-fno-exceptions' testing (was: Skip a number of C++ test cases for '-fno-exceptions' testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')) In-Reply-To: <87wn04eoyd.fsf@euler.schwinge.homeip.net> References: <873534qu9e.fsf@euler.schwinge.homeip.net> <87wn04eoyd.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Thu, 15 Jun 2023 17:47:57 +0200 Message-ID: <87ttv8engy.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2023-06-15T17:15:54+0200, I wrote: > On 2023-06-06T20:31:21+0100, Jonathan Wakely wrote: >> On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge w= rote: >>> 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=3D'--target_board=3Dunix/-fno-exceptions\{,-m32\}' >>> >>> ..., I find that indeed this does work for a lot of test cases, where w= e >>> 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 disab= led >>> >>> ..., 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 a= re >>> 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++. [...] > Not having heard anything contrary regarding the compiler side of things, > I've now been working on that, see below. >>> 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"? Similarly, OK to push the attached "Skip a number of C++ "split files" test cases for '-fno-exceptions' testin= g"? Gr=C3=BC=C3=9Fe Thomas >>> (Or, >>> 'error: exception handling disabled' made a "really late" diagnostic, s= o >>> 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 th= at >>> 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, ju= st >> 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=C3=BC=C3=9Fe > Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Skip-a-number-of-C-split-files-test-cases-for-fno-ex.patch" >From ff03a142dcdb8e2225a57f62bbc7679c384e88e5 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 7 Jun 2023 16:11:11 +0200 Subject: [PATCH] Skip a number of C++ "split files" 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, this doesn't work for "split files" test cases. For example: PASS: g++.dg/compat/eh/ctor1 cp_compat_main_tst.o compile [-PASS:-]{+UNSUPPORTED:+} g++.dg/compat/eh/ctor1 cp_compat_x_tst.o [-compile-]{+compile: exception handling disabled+} [-PASS:-]{+UNSUPPORTED:+} g++.dg/compat/eh/ctor1 cp_compat_y_tst.o [-compile-]{+compile: exception handling disabled+} [-PASS:-]{+UNRESOLVED:+} g++.dg/compat/eh/ctor1 cp_compat_x_tst.o-cp_compat_y_tst.o link [-PASS:-]{+UNRESOLVED:+} g++.dg/compat/eh/ctor1 cp_compat_x_tst.o-cp_compat_y_tst.o execute ..., or: [-PASS:-]{+UNSUPPORTED:+} g++.dg/lto/20081109-1 cp_lto_20081109-1_0.o [-assemble,-]{+assemble: exception handling disabled+} {+UNRESOLVED: g++.dg/lto/20081109-1 cp_lto_20081109-1_0.o-cp_lto_20081109-1_0.o execute+} -fPIC -flto -flto-partition=1to1 [-PASS:-]{+UNRESOLVED:+} g++.dg/lto/20081109-1 cp_lto_20081109-1_0.o-cp_lto_20081109-1_0.o [-link,-]{+link+} -fPIC -flto -flto-partition=1to1 The "compile"/"assemble" ones (either continue to work, or) result in the expected 'UNSUPPORTED: [...] compile: exception handling disabled', but "link" and "execute" ones then turn UNRESOLVED. Specify 'dg-require-effective-target exceptions_enabled' for those test cases. gcc/testsuite/ * g++.dg/compat/eh/ctor1_main.C: Specify 'dg-require-effective-target exceptions_enabled'. * g++.dg/compat/eh/ctor2_main.C: Likewise. * g++.dg/compat/eh/dtor1_main.C: Likewise. * g++.dg/compat/eh/filter1_main.C: Likewise. * g++.dg/compat/eh/filter2_main.C: Likewise. * g++.dg/compat/eh/new1_main.C: Likewise. * g++.dg/compat/eh/nrv1_main.C: Likewise. * g++.dg/compat/eh/spec3_main.C: Likewise. * g++.dg/compat/eh/template1_main.C: Likewise. * g++.dg/compat/eh/unexpected1_main.C: Likewise. * g++.dg/compat/init/array5_main.C: Likewise. * g++.dg/lto/20081109-1_0.C: Likewise. * g++.dg/lto/20081109_0.C: Likewise. * g++.dg/lto/20091026-1_0.C: Likewise. * g++.dg/lto/pr87906_0.C: Likewise. * g++.dg/lto/pr88046_0.C: Likewise. --- gcc/testsuite/g++.dg/compat/eh/ctor1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/ctor2_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/dtor1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/filter1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/filter2_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/new1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/nrv1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/spec3_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/template1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C | 2 ++ gcc/testsuite/g++.dg/compat/init/array5_main.C | 2 ++ gcc/testsuite/g++.dg/lto/20081109-1_0.C | 1 + gcc/testsuite/g++.dg/lto/20081109_0.C | 2 ++ gcc/testsuite/g++.dg/lto/20091026-1_0.C | 1 + gcc/testsuite/g++.dg/lto/pr87906_0.C | 1 + gcc/testsuite/g++.dg/lto/pr88046_0.C | 1 + 16 files changed, 28 insertions(+) diff --git a/gcc/testsuite/g++.dg/compat/eh/ctor1_main.C b/gcc/testsuite/g++.dg/compat/eh/ctor1_main.C index a188b46da86..bd766a1dc10 100644 --- a/gcc/testsuite/g++.dg/compat/eh/ctor1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/ctor1_main.C @@ -4,6 +4,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void ctor1_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/ctor2_main.C b/gcc/testsuite/g++.dg/compat/eh/ctor2_main.C index 58836e26eba..10e26cd168b 100644 --- a/gcc/testsuite/g++.dg/compat/eh/ctor2_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/ctor2_main.C @@ -4,6 +4,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void ctor2_x (void); int main () diff --git a/gcc/testsuite/g++.dg/compat/eh/dtor1_main.C b/gcc/testsuite/g++.dg/compat/eh/dtor1_main.C index 962fa64274b..733c42154e0 100644 --- a/gcc/testsuite/g++.dg/compat/eh/dtor1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/dtor1_main.C @@ -5,6 +5,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void dtor1_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/filter1_main.C b/gcc/testsuite/g++.dg/compat/eh/filter1_main.C index 2a8fca42c31..797da5d4d36 100644 --- a/gcc/testsuite/g++.dg/compat/eh/filter1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/filter1_main.C @@ -2,6 +2,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void filter1_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/filter2_main.C b/gcc/testsuite/g++.dg/compat/eh/filter2_main.C index 866199c6b30..297eef1f3af 100644 --- a/gcc/testsuite/g++.dg/compat/eh/filter2_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/filter2_main.C @@ -3,6 +3,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void filter2_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/new1_main.C b/gcc/testsuite/g++.dg/compat/eh/new1_main.C index ee4cad8e50d..d08cc41d779 100644 --- a/gcc/testsuite/g++.dg/compat/eh/new1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/new1_main.C @@ -4,6 +4,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void new1_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/nrv1_main.C b/gcc/testsuite/g++.dg/compat/eh/nrv1_main.C index 3b76b5c8824..1b813f12f3a 100644 --- a/gcc/testsuite/g++.dg/compat/eh/nrv1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/nrv1_main.C @@ -3,6 +3,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void nrv1_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/spec3_main.C b/gcc/testsuite/g++.dg/compat/eh/spec3_main.C index 3f0e919b2ea..6c72d54c7ff 100644 --- a/gcc/testsuite/g++.dg/compat/eh/spec3_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/spec3_main.C @@ -3,6 +3,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void spec3_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/template1_main.C b/gcc/testsuite/g++.dg/compat/eh/template1_main.C index 2d169808c46..87b0e3f9fb4 100644 --- a/gcc/testsuite/g++.dg/compat/eh/template1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/template1_main.C @@ -3,6 +3,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void template1_x (void); int diff --git a/gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C b/gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C index 1658db77e32..208edb4fcb3 100644 --- a/gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C +++ b/gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C @@ -3,6 +3,8 @@ // Split into pieces for binary compatibility testing October 2002 +// { dg-require-effective-target exceptions_enabled } + extern void unexpected1_x (); int diff --git a/gcc/testsuite/g++.dg/compat/init/array5_main.C b/gcc/testsuite/g++.dg/compat/init/array5_main.C index 96b2cc4b12b..e981f58740a 100644 --- a/gcc/testsuite/g++.dg/compat/init/array5_main.C +++ b/gcc/testsuite/g++.dg/compat/init/array5_main.C @@ -5,6 +5,8 @@ // Incorrect construction and destruction of multi-dimensional // array of class. +// { dg-require-effective-target exceptions_enabled } + extern void array5_x (void); int diff --git a/gcc/testsuite/g++.dg/lto/20081109-1_0.C b/gcc/testsuite/g++.dg/lto/20081109-1_0.C index db0ba367fe8..f1a4b101cca 100644 --- a/gcc/testsuite/g++.dg/lto/20081109-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20081109-1_0.C @@ -1,4 +1,5 @@ // { dg-lto-do link } +// { dg-require-effective-target exceptions_enabled } // { dg-require-effective-target fpic } // { dg-lto-options {{-fPIC -flto -flto-partition=1to1}} } // { dg-extra-ld-options "-fPIC -flto -flto-partition=1to1 -r -fno-exceptions -flinker-output=nolto-rel" } diff --git a/gcc/testsuite/g++.dg/lto/20081109_0.C b/gcc/testsuite/g++.dg/lto/20081109_0.C index 93cfc67fff2..6ab27d900cc 100644 --- a/gcc/testsuite/g++.dg/lto/20081109_0.C +++ b/gcc/testsuite/g++.dg/lto/20081109_0.C @@ -1,3 +1,5 @@ +// { dg-require-effective-target exceptions_enabled } + extern "C" { void abort (void);} int foo (int); diff --git a/gcc/testsuite/g++.dg/lto/20091026-1_0.C b/gcc/testsuite/g++.dg/lto/20091026-1_0.C index 06eff292cb6..2b666b88282 100644 --- a/gcc/testsuite/g++.dg/lto/20091026-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20091026-1_0.C @@ -1,4 +1,5 @@ // { dg-lto-do link } +// { dg-require-effective-target exceptions_enabled } // { dg-extra-ld-options "-r -nostdlib -flinker-output=nolto-rel" } #include "20091026-1_a.h" diff --git a/gcc/testsuite/g++.dg/lto/pr87906_0.C b/gcc/testsuite/g++.dg/lto/pr87906_0.C index 6a04cd5c6f0..b76855b6ed7 100644 --- a/gcc/testsuite/g++.dg/lto/pr87906_0.C +++ b/gcc/testsuite/g++.dg/lto/pr87906_0.C @@ -1,4 +1,5 @@ // { dg-lto-do link } +// { dg-require-effective-target exceptions_enabled } // { dg-require-effective-target fpic } // { dg-require-effective-target shared } // { dg-lto-options { { -O -fPIC -flto } } } diff --git a/gcc/testsuite/g++.dg/lto/pr88046_0.C b/gcc/testsuite/g++.dg/lto/pr88046_0.C index 734ce86e9b8..79efd88f210 100644 --- a/gcc/testsuite/g++.dg/lto/pr88046_0.C +++ b/gcc/testsuite/g++.dg/lto/pr88046_0.C @@ -1,5 +1,6 @@ // { dg-lto-do link } // { dg-lto-options { { -O2 -fPIC -flto } } } +// { dg-require-effective-target exceptions_enabled } // { dg-require-effective-target shared } // { dg-require-effective-target fpic } // { dg-extra-ld-options "-shared -g" } -- 2.34.1 --=-=-=--