From patchwork Tue May 9 12:54:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1778973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QFymY1TW3z214S for ; Tue, 9 May 2023 22:54:52 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1705B385734A for ; Tue, 9 May 2023 12:54:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 3A9773858D37 for ; Tue, 9 May 2023 12:54:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A9773858D37 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,262,1677571200"; d="scan'208,223";a="5325679" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 09 May 2023 04:54:34 -0800 IronPort-SDR: ogBJ/JHLnZGUGuZZubp7SvHzNNd/BE4gHDftAl2fhJ/rQ612GUEEdpjnIdt9PrGIw6pmFEM6XO si1UHOSwQXB5lU2aZMkBKOUbgL6OY2kJhRAIuHgZDC0f6uDwmiAGwNVTPmmWzSOe0lpuNpjU/N 3lTjr1kp+eIcFmog4FG1PgGVAD2n5Ir2jOCtpc3+rH/u44NHWYueeb0GM7IRed9DHSeM7rjLKK SLEXpokRc04URzG005gOXNL+Fb+qdc5jQSm48AO6+2LxFu9j0/0Boa0d5Y+KgL5ddi7ZQYnCXW 5T0= From: Thomas Schwinge To: Mike Stump , CC: Jakub Jelinek , Rainer Orth , Tobias Burnus Subject: libgomp testsuite: Localize 'lang_[...]' etc. (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: Tue, 9 May 2023 14:54:21 +0200 Message-ID: <87ttwlacn6.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 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.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2014-11-04T10:31:37-0800, Mike Stump wrote: > I wonder if any variables that you set that need to be cleared out are, that seems a defect in the api or conventions we use and it can screw following tests with a wrong environment in subtle ways. I could miss accidental bleed over from the .exp you’re modifying into other unrelated parts of the test suite. Aye, that topic keeps coming back... ;-\ I'm not aware of any such defects in my changes, but I do agree that the current structure of the libgomp testsuite is a bit weird in that regard: that every '*.exp' file begins with a bunch of conditional 'unset lang_[...]' to clean up what the previous '*.exp' file left behind. I propose to simplify this as per the attached "libgomp testsuite: Localize 'lang_[...]' etc." -- OK to push? (That's a 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.) 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 6230d3b0aef9b785c7d62c512e8939cca183fdb4 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 9 May 2023 10:09:35 +0200 Subject: [PATCH] libgomp testsuite: Localize 'lang_[...]' etc. ..., instead of letting them bleed into the next '*.exp' file, requiring clean-up there. libgomp/ * testsuite/libgomp.c++/c++.exp: Localize 'lang_[...]' etc. * testsuite/libgomp.c/c.exp: Likewise. * testsuite/libgomp.fortran/fortran.exp: Likewise. * testsuite/libgomp.graphite/graphite.exp: Likewise. * testsuite/libgomp.oacc-c++/c++.exp: Likewise. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. --- libgomp/testsuite/libgomp.c++/c++.exp | 11 ++++++++--- libgomp/testsuite/libgomp.c/c.exp | 11 ----------- libgomp/testsuite/libgomp.fortran/fortran.exp | 15 ++++++++++----- libgomp/testsuite/libgomp.graphite/graphite.exp | 11 ----------- libgomp/testsuite/libgomp.oacc-c++/c++.exp | 11 ++++++++--- libgomp/testsuite/libgomp.oacc-c/c.exp | 11 ----------- .../testsuite/libgomp.oacc-fortran/fortran.exp | 15 ++++++++++----- 7 files changed, 36 insertions(+), 49 deletions(-) diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp index 7dd2d49d568..442e9f744d0 100644 --- a/libgomp/testsuite/libgomp.c++/c++.exp +++ b/libgomp/testsuite/libgomp.c++/c++.exp @@ -7,9 +7,6 @@ set shlib_ext [get_shlib_extension] set lang_link_flags "-lstdc++" set lang_test_file_found 0 set lang_library_path "../libstdc++-v3/src/.libs" -if [info exists lang_include_flags] then { - unset lang_include_flags -} # If a testcase doesn't have special options, use these. if ![info exists DEFAULT_CFLAGS] then { @@ -71,5 +68,13 @@ if { $lang_test_file_found } { # See above. set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" +if [info exists lang_include_flags] then { + unset lang_source_re + unset lang_include_flags +} +unset lang_library_path +unset lang_link_flags +unset lang_test_file_found + # All done. dg-finish diff --git a/libgomp/testsuite/libgomp.c/c.exp b/libgomp/testsuite/libgomp.c/c.exp index e67adc8b378..0ee28ed723e 100644 --- a/libgomp/testsuite/libgomp.c/c.exp +++ b/libgomp/testsuite/libgomp.c/c.exp @@ -1,14 +1,3 @@ -if [info exists lang_library_path] then { - unset lang_library_path - unset lang_link_flags -} -if [info exists lang_test_file_found] then { - unset lang_test_file_found -} -if [info exists lang_include_flags] then { - unset lang_include_flags -} - load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp index 5e8e15e7743..7ea00a25bd9 100644 --- a/libgomp/testsuite/libgomp.fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.fortran/fortran.exp @@ -8,12 +8,7 @@ global ALWAYS_CFLAGS set shlib_ext [get_shlib_extension] set lang_library_path "../libgfortran/.libs" set lang_link_flags "-lgfortran -foffload=-lgfortran" -if [info exists lang_include_flags] then { - unset lang_include_flags -} set lang_test_file_found 0 -set quadmath_library_path "../libquadmath/.libs" - # Initialize dg. dg-init @@ -44,6 +39,7 @@ if { $lang_test_file_found } { set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]] if { $blddir != "" } { + set quadmath_library_path "../libquadmath/.libs" if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"] || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } { lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/" @@ -54,6 +50,7 @@ if { $lang_test_file_found } { } else { set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" } + unset quadmath_library_path } else { set ld_library_path "$always_ld_library_path" if { [check_no_compiler_messages has_libquadmath executable { @@ -71,5 +68,13 @@ if { $lang_test_file_found } { gfortran-dg-runtest $tests "" "" } +if { $blddir != "" } { + unset lang_source_re + unset lang_include_flags +} +unset lang_library_path +unset lang_link_flags +unset lang_test_file_found + # All done. dg-finish diff --git a/libgomp/testsuite/libgomp.graphite/graphite.exp b/libgomp/testsuite/libgomp.graphite/graphite.exp index 1c5ea663af3..ff53a31272c 100644 --- a/libgomp/testsuite/libgomp.graphite/graphite.exp +++ b/libgomp/testsuite/libgomp.graphite/graphite.exp @@ -14,17 +14,6 @@ # along with GCC; see the file COPYING3. If not see # . -if [info exists lang_library_path] then { - unset lang_library_path - unset lang_link_flags -} -if [info exists lang_test_file_found] then { - unset lang_test_file_found -} -if [info exists lang_include_flags] then { - unset lang_include_flags -} - load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index 24ab8bb35ff..5d9dc5d4a3f 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -17,9 +17,6 @@ set shlib_ext [get_shlib_extension] set lang_link_flags "-lstdc++" set lang_test_file_found 0 set lang_library_path "../libstdc++-v3/src/.libs" -if [info exists lang_include_flags] then { - unset lang_include_flags -} # Initialize dg. dg-init @@ -152,6 +149,14 @@ if { $lang_test_file_found } { # See above. set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" +if [info exists lang_include_flags] then { + unset lang_source_re + unset lang_include_flags +} +unset lang_library_path +unset lang_link_flags +unset lang_test_file_found + # All done. torture-finish dg-finish diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp index 8a960aafadc..ca61a82937a 100644 --- a/libgomp/testsuite/libgomp.oacc-c/c.exp +++ b/libgomp/testsuite/libgomp.oacc-c/c.exp @@ -1,16 +1,5 @@ # This whole file adapted from libgomp.c/c.exp. -if [info exists lang_library_path] then { - unset lang_library_path - unset lang_link_flags -} -if [info exists lang_test_file_found] then { - unset lang_test_file_found -} -if [info exists lang_include_flags] then { - unset lang_include_flags -} - load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp load_gcc_lib torture-options.exp diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp index a56c7d90350..1ac2320ec22 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -10,12 +10,7 @@ global ALWAYS_CFLAGS set shlib_ext [get_shlib_extension] set lang_library_path "../libgfortran/.libs" set lang_link_flags "-lgfortran -foffload=-lgfortran" -if [info exists lang_include_flags] then { - unset lang_include_flags -} set lang_test_file_found 0 -set quadmath_library_path "../libquadmath/.libs" - # Initialize dg. dg-init @@ -46,6 +41,7 @@ if { $lang_test_file_found } { set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]] if { $blddir != "" } { + set quadmath_library_path "../libquadmath/.libs" if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"] || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } { lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/" @@ -56,6 +52,7 @@ if { $lang_test_file_found } { } else { set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" } + unset quadmath_library_path } else { set ld_library_path "$always_ld_library_path" if { [check_no_compiler_messages has_libquadmath executable { @@ -120,5 +117,13 @@ if { $lang_test_file_found } { unset offload_target } +if { $blddir != "" } { + unset lang_source_re + unset lang_include_flags +} +unset lang_library_path +unset lang_link_flags +unset lang_test_file_found + # All done. dg-finish -- 2.34.1