public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] testsuite: Default make check-g++ vs. tests for newest C++ standard
Date: Wed, 19 Oct 2022 11:47:15 -0400	[thread overview]
Message-ID: <5ab36891-0b47-0637-e556-21b5dee2b2c4@redhat.com> (raw)
In-Reply-To: <Y1AXafpqS9xxvvTp@tucnak>

On 10/19/22 11:27, Jakub Jelinek wrote:
> Hi!
> 
> On Wed, Oct 19, 2022 at 09:10:48AM -0400, Jason Merrill wrote:
>>> The screw-up on my side with libstdc++ testing (tested normally rather
>>> than in C++23 mode) makes me wonder if we couldn't tweak the default
>>> testing.
>>> Dunno what libstdc++ testing normally does (just C++17?), make check-g++
>>> tests by default { 98, 14, 17, 20 } (and I regularly use
>>> GXX_TESTSUITE_STDS=98,11,14,17,20,2b in environment but that doesn't
>>> cover libstdc++ I guess).
>>> When adding tests for upcoming C++ version, one always has a dilemma
>>> whether to use explicit // { dg-options "-std=c++2b" }
>>> or -std=gnu++2b and similar, then the test works in all modes, but it might
>>> be forgotten later on to be converted into // { dg-do whatever { target c++23 } }
>>> test so that when 23 is tested by default and say 26 or 29 appears too,
>>> we test it also in those modes, or just go with
>>> // { dg-do whatever { target c++23 } }
>>> which has the disadvantage that it is skipped when testing by default and
>>> one only tests it if he asks for the newer version.
>>>
>>> I wonder if we couldn't for the default testing (when one doesn't
>>> specify GXX_TESTSUITE_STDS or uses make check-c++-all and similar)
>>> improve things a little bit by automatically treat those
>>> // { dg-do whatever { target c++23 } }
>>> tests as // { dg-options "-std=c++2b" }.
>>
>> That would be great.
> 
> Here is a patch that implements it.
> On make check-g++ RUNTESTFLAGS=dg.exp=cpp23/*.C
> the vanilla vs. patched gcc difference is:
>                  === g++ Summary ===
> 
> # of expected passes            1743
> # of expected failures          2
> # of unsupported tests          224
> vs.
>                  === g++ Summary ===
> 
> # of expected passes            1829
> # of expected failures          2
> # of unsupported tests          112
> 
> (g++.sum details attached).

OK, thanks.

> 2022-10-19  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* lib/g++-dg.exp (g++-dg-runtest): When using defaulted
> 	std_list, if test has { dg-do * { target c++23 } } directive,
> 	use { 23 } with which the test will run instead of { 98 14 17 20 }
> 	which would make it UNSUPPORTED in all cases.
> 
> --- gcc/testsuite/lib/g++-dg.exp.jj	2022-03-30 09:11:53.306103969 +0200
> +++ gcc/testsuite/lib/g++-dg.exp	2022-10-19 17:10:51.574866364 +0200
> @@ -53,7 +53,16 @@ proc g++-dg-runtest { testcases flags de
>   	    if { [llength $gpp_std_list] > 0 } {
>   		set std_list $gpp_std_list
>   	    } else {
> -		set std_list { 98 14 17 20 }
> +		# If the test requires a newer C++ version than which
> +		# is tested by default, use that C++ version for that
> +		# single test.  This should be updated or commented
> +		# out whenever the default std_list is updated or newer
> +		# C++ effective target is added.
> +		if [search_for $test "{ dg-do * { target c++23 } }"] {
> +		    set std_list { 23 }
> +		} else {
> +		    set std_list { 98 14 17 20 }
> +		}
>   	    }
>   	    set option_list { }
>   	    foreach x $std_list {
> 
> 
> 	Jakub


      reply	other threads:[~2022-10-19 15:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Y0+36fGnYINE/VJN@tucnak>
     [not found] ` <2bfe4f0a-84cc-aae8-1834-6dff3918810a@redhat.com>
2022-10-19 15:27   ` Jakub Jelinek
2022-10-19 15:47     ` Jason Merrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ab36891-0b47-0637-e556-21b5dee2b2c4@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).