From patchwork Fri May 12 08:27:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 92997 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4936843vqo; Fri, 12 May 2023 01:28:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rBBVxqSxlyWxpIDZVQiPK+2so+ARE2a0oavxwxRw0o55FW4GQNg8FPioEB5INZqgG+Yy0 X-Received: by 2002:a50:ed0b:0:b0:506:943a:6a5f with SMTP id j11-20020a50ed0b000000b00506943a6a5fmr17098885eds.36.1683880097460; Fri, 12 May 2023 01:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683880097; cv=none; d=google.com; s=arc-20160816; b=npCBWyCxLYbpi7fpSBdSisc/mLXeqICBywW/Z2kRQBIhXSlf5LX2zs1d8OCWQ+ReUj gSiwo2CkEs96S7d4T/RlYHRasUiOClrbzE2MbYwrjagYG3G7WPL3J0LBv/U2l/xzKvZs 31azptOyb/jV2zRZmAR+kZgUQoGzTstoWDcrmPa7M2SDxPGEpPn3D3u2/5t9Nr/gladb 495RYTMxpzpK6v8P1APH7yPLFFCxrtPPfya4SEkSVCH7Oz9x90ym5g036JubJp710uIb 0obDdgMSkBaKCNhsP0dhxa1Xdq5GtVIk5agz/TcTYwkuDfGcRcs8H0gNJwfHAzPyie0t Q1jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=JxLG332Y3QVBNIGA4YSsl6Jhb+dPiWZTpHI4TS6idEk=; b=gIZlkawazuKM1YF5x4OAT62I+pV6yZKLeSGpzM09YinA3+0PTD0LbDdb1PQelOBK2+ p9u+cXgLF9FHDtL2j+9vEpvOE72v+4EJEd5eWtse6ZjkFZfFwh8bNmVBex6lP9JzyGIV Ao33NFf4AKtHGN4JQjH2C4EnpSiCNI7JaUY5iTaVGGWvC18veyEpfQTC74+aQwEPA0zk U7mpbj3tHzVZFdqy3ZInU/nUbAmT4EDjzrrmiHQGhokgVyot+6Ld8Oy5PVJd3PDhmb7B WoKNIU95EDBT16h6TzzwcRgJ8iKwG7UD/2sfwJ01vSZDD/vMQ4HJhlOpnDLvUgcSDWep ug5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x24-20020aa7d6d8000000b0050bcaedc29esi6131353edr.383.2023.05.12.01.28.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 01:28:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A26C0385696A for ; Fri, 12 May 2023 08:28:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id D7EAF3858C54 for ; Fri, 12 May 2023 08:27:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7EAF3858C54 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="5.99,269,1677571200"; d="scan'208,223";a="5024162" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 12 May 2023 00:27:38 -0800 IronPort-SDR: IzJwH2QDPmymmoQT7VOqlNJazRDCwHO6UMc3ob/9Pl4z7D6gGGRjDzFtPLjtdh9iO2vN57+3mN wlfdc3GdbqwsEw9YWS6q5OJg/QjOKXYexJAHl7SqawlOoz9il1GSeqsD0C6adFtk63wev8e/Qv l1qiQE0hd7Qam7ALyqtSyG3UYE+67VOvpQ2wMaqJUJouSEpcRR+9KlAOfBTs1K6GqKMZlToRbA kyy4fByGsY7x1iwl/RSFxy21dTIB/QsAZtKRi4Bvl41Sco4xsxpUtKRLiIVgzrcnWde0mSXsfs ws4= From: Thomas Schwinge To: CC: Mike Stump , Jakub Jelinek , Tobias Burnus , Rainer Orth Subject: libgomp testsuite: Have each '*.exp' file specify the compiler to use [PR91884] (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?) In-Reply-To: References: <87h9z5wd1z.fsf@schwinge.name> <87y4rrrwnc.fsf@schwinge.name> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Fri, 12 May 2023 10:27:29 +0200 Message-ID: <87bkiq9cpa.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765676257375373601?= X-GMAIL-MSGID: =?utf-8?q?1765676257375373601?= Hi! The cleanup is done, now turn ourselves to the changes proper re PR91884 "libgomp testsuite: (not) using a specific driver for C++, Fortran": On 2014-11-04T10:31:37-0800, Mike Stump wrote: > On Nov 4, 2014, at 4:13 AM, Thomas Schwinge wrote: >> On Wed, 15 Oct 2014 17:46:48 +0200, I wrote: >>> No matter whether it's C, C++, or Fortran source code, the libgomp >>> testsuite always uses (for build-tree testing) gcc/xgcc, or (for >>> installed testing) GCC_UNDER_TEST. It doesn't make use of >>> GXX_UNDER_TEST, GFORTRAN_UNDER_TEST. To support the latter two >>> languages' needs, some -l[...] flags are then added via lang_link_flags. >>> For example, for Fortran this is -lgfortran. This is, however, not what >>> would happen if using the gfortran driver to build (which is what a user >>> would be doing -- which we should replicate as much as possible at least >>> for installed testing): the gfortran driver also adds -lquadmath, if >>> applicable. >>> >>> Now, I wonder why to re-invent all that in the libgomp testsuite, if the >>> respective driver already has that knowledge, via spec files, for >>> example? (Also, the regular GCC compiler tests, gcc/testsuite/, are >>> doing the right thing.) Why is libgomp testsuite implemented this way -- >>> just a legacy of the past, or is there a need for that (that I'm not >>> seeing)? >>> >>> [...] >>> >>> Am I on the right track with the following? >> >> Nobody commented, which also means nobody disagreed > > :-) > >> OK to commit all that to trunk? > > Ok, thanks. > Watch for any review points from the libgomp people, they might trickle a few in. I don’t mean to cut short any review points from them. After Tobias in his 2019 "PR testsuite/91884 Add -lquadmath if available" again picked up my idea and parts of my 2014 patches (... but in the end settled for a "simpler" solution to the problem at hand), my original proposal also got an ACK from Rainer, . > Also, please watch for breakage. Always. :-) First, another "no change in behavior" new patch, loosely based on/extracted out of my earlier work. I'm posting it separately, but given that it's in line with my earlier work (just a separate step), I intend to push it soon, unless there are any objections, of course. "libgomp testsuite: Have each '*.exp' file specify the compiler to use [PR91884]" ("..., which is still 'GCC_UNDER_TEST' for all of them"), see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 1b2c8132495435dd4455a1c79e5abbd88073c754 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 10 May 2023 14:43:21 +0200 Subject: [PATCH] libgomp testsuite: Have each '*.exp' file specify the compiler to use [PR91884] ..., which is still 'GCC_UNDER_TEST' for all of them; no change in behavior. PR testsuite/91884 libgomp/ * testsuite/lib/libgomp.exp (libgomp_target_compile): Don't specify compiler. * testsuite/libgomp.c++/c++.exp (ALWAYS_CFLAGS): Specify compiler. * testsuite/libgomp.c/c.exp (ALWAYS_CFLAGS): Likewise. * testsuite/libgomp.fortran/fortran.exp (ALWAYS_CFLAGS): Likewise. * testsuite/libgomp.graphite/graphite.exp (ALWAYS_CFLAGS): Likewise. * testsuite/libgomp.oacc-c++/c++.exp (ALWAYS_CFLAGS): Likewise. * testsuite/libgomp.oacc-c/c.exp (ALWAYS_CFLAGS): Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp (ALWAYS_CFLAGS): Likewise. --- libgomp/testsuite/lib/libgomp.exp | 5 ----- libgomp/testsuite/libgomp.c++/c++.exp | 10 +++++----- libgomp/testsuite/libgomp.c/c.exp | 2 ++ libgomp/testsuite/libgomp.fortran/fortran.exp | 1 + libgomp/testsuite/libgomp.graphite/graphite.exp | 1 + libgomp/testsuite/libgomp.oacc-c++/c++.exp | 10 +++++----- libgomp/testsuite/libgomp.oacc-c/c.exp | 2 ++ libgomp/testsuite/libgomp.oacc-fortran/fortran.exp | 1 + 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 9fea31d8067..48c43e4a136 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -46,10 +46,6 @@ load_file libgomp-test-support.exp set dg-do-what-default run -# -# GCC_UNDER_TEST is the compiler under test. -# - set libgomp_compile_options "" # @@ -262,7 +258,6 @@ proc libgomp_target_compile { source dest type options } { lappend options "additional_flags=[libio_include_flags]" lappend options "timeout=[timeout_value]" - lappend options "compiler=$GCC_UNDER_TEST" set options [concat $libgomp_compile_options $options] diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp index 1a1c3ee2225..4110ada7c46 100644 --- a/libgomp/testsuite/libgomp.c++/c++.exp +++ b/libgomp/testsuite/libgomp.c++/c++.exp @@ -16,6 +16,11 @@ if { $blddir != "" } { return } set lang_link_flags "-lstdc++" +# Switch into C++ mode. Otherwise, the 'libgomp.c-c++-common/*.c' +# files would be compiled as C files. +set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST" +set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++" +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" # If a testcase doesn't have special options, use these. if ![info exists DEFAULT_CFLAGS] then { @@ -28,11 +33,6 @@ dg-init # Turn on OpenMP. lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" -# Switch into C++ mode. Otherwise, the libgomp.c-c++-common/*.c -# files would be compiled as C files. -set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST" -set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++" - # Gather a list of all tests. set tests [lsort [concat \ [find $srcdir/$subdir *.C] \ diff --git a/libgomp/testsuite/libgomp.c/c.exp b/libgomp/testsuite/libgomp.c/c.exp index 0ee28ed723e..aae282478db 100644 --- a/libgomp/testsuite/libgomp.c/c.exp +++ b/libgomp/testsuite/libgomp.c/c.exp @@ -1,6 +1,8 @@ load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" + # If a testcase doesn't have special options, use these. if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS "-O2" diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp index 9295bbae65d..9aeebd3af7c 100644 --- a/libgomp/testsuite/libgomp.fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.fortran/fortran.exp @@ -29,6 +29,7 @@ if { $blddir != "" } { set lang_include_flags "-fintrinsic-modules-path=${blddir}" } set lang_link_flags "-lgfortran -foffload=-lgfortran" +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" # Initialize dg. dg-init diff --git a/libgomp/testsuite/libgomp.graphite/graphite.exp b/libgomp/testsuite/libgomp.graphite/graphite.exp index ff53a31272c..bc3a82d8804 100644 --- a/libgomp/testsuite/libgomp.graphite/graphite.exp +++ b/libgomp/testsuite/libgomp.graphite/graphite.exp @@ -25,6 +25,7 @@ if ![check_effective_target_fgraphite] { return } +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" # Flags for force-parallel-*.c testcases. set PARALLEL_CFLAGS "-ansi -pedantic-errors -O2 \ -ftree-parallelize-loops=4 -floop-parallelize-all \ diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index 63d1d7650a2..70fb9da0ef4 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -26,6 +26,11 @@ if { $blddir != "" } { return } set lang_link_flags "-lstdc++" +# Switch into C++ mode. Otherwise, the 'libgomp.oacc-c-c++-common/*.c' +# files would be compiled as C files. +set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST" +set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++" +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" # Initialize dg. dg-init @@ -34,11 +39,6 @@ torture-init # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=-fopenacc" -# Switch into C++ mode. Otherwise, the libgomp.oacc-c-c++-common/*.c -# files would be compiled as C files. -set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST" -set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++" - # Gather a list of all tests. set tests [lsort [concat \ [find $srcdir/$subdir *.C] \ diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp index ca61a82937a..8ca0c81687c 100644 --- a/libgomp/testsuite/libgomp.oacc-c/c.exp +++ b/libgomp/testsuite/libgomp.oacc-c/c.exp @@ -15,6 +15,8 @@ proc check_effective_target_c++ { } { dg-init torture-init +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" + # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=-fopenacc" diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp index af0a4f7ff31..56dd9485339 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -31,6 +31,7 @@ if { $blddir != "" } { set lang_include_flags "-fintrinsic-modules-path=${blddir}" } set lang_link_flags "-lgfortran -foffload=-lgfortran" +lappend ALWAYS_CFLAGS "compiler=$GCC_UNDER_TEST" # Initialize dg. dg-init -- 2.34.1