From patchwork Wed Jan 2 12:58:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 209040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 45CB92C007D for ; Wed, 2 Jan 2013 23:59:05 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1357736346; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=K7a4q3g9W77D2H71viff lf0UMUY=; b=VRZQI6XL92COqyW9X8oXaQtMEDFkmO1iYGdePDDmzjhPNCzQk4o/ L0lkMCra8AzCyjqdo83v5jOjQn6PneWTDjJOQLFQ/juAoFUtTmA/MZBIS0bogGsN KSqVUkr/cZxkH3bBNNjCxDaNoom462E2czsd7NzrVuaekNgJ/CPbU2g= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Hk5CTVhA1G3QgVhB43GKfVOn8GWRH4SG63jT3a2bZxZyKsa4TXN3sIWPePa2HE uY4hii+z509KKL0N0d7bQeKJ+rroYr+E+PlsVEh3LTWqxaUmvV9+eH1eFIy1F+8Z gBG2M5ZwhNc08subooqPVuuH4fbRYjSJhqHRWjVMvI6t4=; Received: (qmail 21771 invoked by alias); 2 Jan 2013 12:58:58 -0000 Received: (qmail 21756 invoked by uid 22791); 2 Jan 2013 12:58:57 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Jan 2013 12:58:22 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r02CwLjK020353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Jan 2013 07:58:21 -0500 Received: from zalov.redhat.com (vpn1-4-52.ams2.redhat.com [10.36.4.52]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r02CwJwC023408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Jan 2013 07:58:20 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r02CwINf007071 for ; Wed, 2 Jan 2013 13:58:18 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r02CwIXN007070 for gcc-patches@gcc.gnu.org; Wed, 2 Jan 2013 13:58:18 +0100 Date: Wed, 2 Jan 2013 13:58:18 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix up compat.exp C testing Message-ID: <20130102125818.GQ2315@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! I've noticed when using ALT_CC_UNDER_TEST=gcc all compat.exp and struct-layout-1.exp tests fail, because prune.exp adds -fno-diagnostics-show-caret unconditionally, which is undesirable if $ALT_CC_UNDER_TEST doesn't support that option (but of course desirable if $ALT_CC_UNDER_TEST supports carets). check-g++ compat.exp & struct-layout-1.exp don't suffer from this problem, because they apparently clear ALWAYS_CXXFLAGS completely in their compat-use-alt-compiler (which isn't right either, when testing say g++ 4.9 against 4.8 we will want to pass -fno-diagnostics-show-caret, and also perhaps -fmessage-length=0 should be passed too conditionally depending on whether alt g++ supports it or not). Another thing is that ALT_*_UNDER_TEST testing doesn't work when testing a compiler built with different prefix from the alt compiler, then the problem is that GCC_RUN_PATH is put into environment. Perhaps compat-use-alt-compiler should remove GCC_RUN_PATH from environment and compat-use-tst-compiler add it back if it was initially in the environment? Anyway, this fixes the most urgent issue. Ok for trunk? 2013-01-02 Jakub Jelinek * lib/c-compat.exp (compat-use-alt-compiler): Remove -fno-diagnostics-show-caret from TEST_ALWAYS_FLAGS if needed. (compat-use-tst-compiler): Restore TEST_ALWAYS_FLAGS. (compat_setup_dfp): Initialize compat_alt_caret and compat_save_TEST_ALWAYS_FLAGS. Jakub --- gcc/testsuite/lib/c-compat.exp.jj 2009-02-20 15:43:09.000000000 +0100 +++ gcc/testsuite/lib/c-compat.exp 2013-01-02 13:41:28.595153560 +0100 @@ -1,4 +1,4 @@ -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2013 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -35,12 +35,16 @@ load_lib target-supports.exp # proc compat-use-alt-compiler { } { global GCC_UNDER_TEST ALT_CC_UNDER_TEST - global compat_same_alt + global compat_same_alt compat_alt_caret + global TEST_ALWAYS_FLAGS # We don't need to do this if the alternate compiler is actually # the same as the compiler under test. if { $compat_same_alt == 0 } then { set GCC_UNDER_TEST $ALT_CC_UNDER_TEST + if { $compat_alt_caret == 0 } then { + regsub -- "-fno-diagnostics-show-caret" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS + } } } @@ -50,12 +54,14 @@ proc compat-use-alt-compiler { } { proc compat-use-tst-compiler { } { global GCC_UNDER_TEST compat_save_gcc_under_test global compat_same_alt + global TEST_ALWAYS_FLAGS compat_save_TEST_ALWAYS_FLAGS # We don't need to do this if the alternate compiler is actually # the same as the compiler under test. if { $compat_same_alt == 0 } then { set GCC_UNDER_TEST $compat_save_gcc_under_test + set TEST_ALWAYS_FLAGS $compat_save_TEST_ALWAYS_FLAGS } } @@ -64,6 +70,11 @@ proc compat_setup_dfp { } { global compat_use_alt global compat_same_alt global compat_have_dfp + global compat_alt_caret + global TEST_ALWAYS_FLAGS compat_save_TEST_ALWAYS_FLAGS + + set compat_alt_caret 0 + set compat_save_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS verbose "compat_setup_dfp: $compat_use_alt $compat_same_alt" 2 @@ -72,6 +83,15 @@ proc compat_setup_dfp { } { set compat_have_dfp [check_effective_target_dfprt_nocache] verbose "compat_have_dfp for tst compiler: $compat_have_dfp" 2 + if { $compat_use_alt == 1 && $compat_same_alt == 0 } { + compat-use-alt-compiler + if { [check_no_compiler_messages_nocache compat_alt_has_caret object { + int dummy; } "-fno-diagnostics-show-caret"] != 0 } { + set compat_alt_caret 1 + } + compat-use-tst-compiler + } + # If there is an alternate compiler, does it support decimal float types? if { $compat_have_dfp == 1 && $compat_use_alt == 1 && $compat_same_alt == 0 } { compat-use-alt-compiler