From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D8B3F38582B6 for ; Wed, 19 Oct 2022 13:10:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D8B3F38582B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666185052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/8OqevYZOo6onpe20/CCvn+A1pKXkwUCVeClm0XGq9I=; b=PLhPwk3vfZVJv/zRuzKo6+E9TeP5FZlzFG5hZ/Obz8a4LrHplluvO3Jk2O9C1G/pUSbuZc VF7E59F88MbeggnZZj+JzwopEHKzNiEIaUcpWasL54oruGv4im8xv6EF8xDLr7xtSinW6d wu6eiDgI6JJkOdiH4V9ICmLugo/TXXI= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-300-U8G2N5hUPqSXByCZk6Seog-1; Wed, 19 Oct 2022 09:10:51 -0400 X-MC-Unique: U8G2N5hUPqSXByCZk6Seog-1 Received: by mail-qv1-f69.google.com with SMTP id y14-20020a0cf14e000000b004afb3c6984bso10746585qvl.21 for ; Wed, 19 Oct 2022 06:10:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/8OqevYZOo6onpe20/CCvn+A1pKXkwUCVeClm0XGq9I=; b=eMSmUscbS1hm8BZXSyOkwxlHQ/rtGfz6zUn1liKAvK/SGJjYvPyeRJBbYAkJZ4VnnJ 7MHZA4HDMxAvtrbF859WS3iVmIiBpMsEh66MuV7FSPblMwJEpIlfE6e2QRv3FkcQrvv3 kH7H2gUjR/iz+mlcUkgGiD286QTUmHyaHPoSPHm8TvBw9+G3dfBuva2OE+j/eNeS+mZy vWeL5yZk1EkPVkJQfLg8rex3TOt4slJMUXvpMT5vy7etx1qBKkXN6NJrV1AQ2tTcUGQq LO4ToMf9m7q2ytFQ0ni8aczjQ3WQKIgMzJ2XfcI9X+L5hxUtVow2pyc7amtrxd5WTHj6 a/1w== X-Gm-Message-State: ACrzQf2pOq+nefGzGLP/3ex/UZkJJjJeQQb53FsP1hxHZ+RZJ90Ip0Ro Lg72BSYLkw9lAfGi+xcDWrFe2ugusnee0ClAcJCYBiUa3prL8wMdwticEdcDHJ1enpS23vQFR4G ouL0SZ60= X-Received: by 2002:a0c:802c:0:b0:4b3:ef3d:9046 with SMTP id 41-20020a0c802c000000b004b3ef3d9046mr6587288qva.109.1666185050989; Wed, 19 Oct 2022 06:10:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JTVmj+87PatiCeW5GDOQQ/iJEA699Cd2ecEMkUVpAVfNoqIKyxkx3BlUXr5+R1QCRnS7PKg== X-Received: by 2002:a0c:802c:0:b0:4b3:ef3d:9046 with SMTP id 41-20020a0c802c000000b004b3ef3d9046mr6587261qva.109.1666185050686; Wed, 19 Oct 2022 06:10:50 -0700 (PDT) Received: from [192.168.1.101] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id y22-20020ac87096000000b0035cd6a4ba3csm4012405qto.39.2022.10.19.06.10.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 06:10:50 -0700 (PDT) Message-ID: <2bfe4f0a-84cc-aae8-1834-6dff3918810a@redhat.com> Date: Wed, 19 Oct 2022 09:10:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [RFC] c++, libstdc++: Default make check vs. tests for newest C++ standard To: Jakub Jelinek , Jonathan Wakely Cc: gcc@gcc.gnu.org References: From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On 10/19/22 04:40, Jakub Jelinek wrote: > Hi! > > 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. > g++-dg.exp has: > # If the testcase specifies a standard, use that one. > # If not, run it under several standards, allowing GNU extensions > # if there's a dg-options line. > if ![search_for $test "-std=*++"] { > if [search_for $test "dg-options"] { > set std_prefix "-std=gnu++" > } else { > set std_prefix "-std=c++" > } > > # See g++.exp for the initial value of this list. > global gpp_std_list > if { [llength $gpp_std_list] > 0 } { > set std_list $gpp_std_list > } else { > set std_list { 98 14 17 20 } > } > set option_list { } > foreach x $std_list { > # Handle "concepts" as C++17 plus Concepts TS. > if { $x eq "concepts" } then { set x "17 -fconcepts" > } elseif { $x eq "impcx" } then { set x "23 -fimplicit-constexpr" } > lappend option_list "${std_prefix}$x" > } > } else { > set option_list { "" } > } > > set nshort [file tail [file dirname $test]]/[file tail $test] > > foreach flags_t $option_list { > verbose "Testing $nshort, $flags $flags_t" 1 > dg-test $test "$flags $flags_t" ${default-extra-flags} > } > so I wonder if in the set std_list { 98 14 17 20 } spot we couldn't do > something like special search_for for "{ dg-do * { target c++23 } }" > and if so, set std_list { 2b } instead of set std_list { 98 14 17 20 }? > It wouldn't handle more complex cases like > // { dg-do compile { target { c++23 && { aarch64*-*-* powerpc64le*-*-linux* riscv*-*-* s390*-*-* sparc*-*-linux* } } } } > but at least for the majority of tests for the new language version > it would run them even in default testing where they'd be otherwise > skipped (we'd cycle over 98 14 17 20 only to see it doesn't satisfy any of > them). > If we wanted to go even further, we could handle similarly say c++11_only > tests. > > What do you think? > > Jakub >