Hi! On Tue, Apr 21, 2020 at 11:57:02AM +0200, Jakub Jelinek wrote: > I haven't added (yet) checks if the alternate compiler does support these > options (I think that can be done incrementally), so for now this testing is > done only if the alternate compiler is not used.
This patch does that, so now when testing against not too old compiler it can do the -std=c++14 vs. -std=c++17 testing also between under test and alt compilers. Tested on x86_64-linux, without ALT_CXX_UNDER_TEST (all tests still used), with ALT_CXX_UNDER_TEST=g++ (all tests still used too), and after tweaking it to test -std=c++20 instead of -std=c++17 that my system g++ doesn't support, where it only used tests before *_32* and bootstrapped/regtested on powerpc64{,le}-linux, ok for trunk? 2020-04-23 Jakub Jelinek <ja...@redhat.com> PR c++/94383 * g++.dg/compat/struct-layout-1.exp: Use the -std=c++14 vs. -std=c++17 ABI compatibility testing even with ALT_CXX_UNDER_TEST, as long as that compiler accepts -std=c++14 and -std=c++17 options. --- gcc/testsuite/g++.dg/compat/struct-layout-1.exp.jj 2020-04-21 17:07:52.004248153 +0200 +++ gcc/testsuite/g++.dg/compat/struct-layout-1.exp 2020-04-23 15:56:16.057326947 +0200 @@ -142,7 +142,19 @@ if { $status == 0 } then { file delete -force $tstobjdir file mkdir $tstobjdir set generator_args "-s $srcdir/$subdir -d $tstobjdir" - if { $use_alt == 0 } then { + set test_cxx14_vs_cxx17 1 + if { $use_alt != 0 } then { + compat-use-alt-compiler + if { [check_no_compiler_messages_nocache compat_alt_has_cxx14 object { + int dummy; } "-std=c++14"] == 0 } { + set test_cxx14_vs_cxx17 0 + } elseif { [check_no_compiler_messages_nocache compat_alt_has_cxx17 object { + int dummy; } "-std=c++17"] == 0 } { + set test_cxx14_vs_cxx17 0 + } + compat-use-tst-compiler + } + if { $test_cxx14_vs_cxx17 != 0 } then { set generator_args "$generator_args -c" } if [info exists env(RUN_ALL_COMPAT_TESTS) ] then { Jakub