From patchwork Tue Mar 29 13:27:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 602900 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qZBRS71LGz9sDC for ; Wed, 30 Mar 2016 00:28:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=NjZN0MJB; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=TiShOHK8Frc0kHx1j1AkPzL3BsZ4K8k3JONQfkyIC7xRLRMQ824Zt a5oTdwZXAg5FQdZTyRWdr4dElYMfZnA3O4aICUgxcMNBJPAU1t0yWF/HxDGjMpVS gjzh3Sk2LLL1EeewrE1/MrUWhtkt1Z47rS9XUESMTvDGBNS/ev8wEo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type:content-transfer-encoding; s=default; bh=0nIQLlYEy+uDRXa88HbDxEuCHYs=; b=NjZN0MJBwLXqVHdRXeBU2r//8u3v X/YZPpnmDfavTNqeo7ZoXekrQ7242WKfl4argGjw4+fZwm2sTgn6j/cM/uJeRYj8 SKWNU1VCKJXlTWEm0BV/5AOpiNF/AgOtcGhM6jTFkTL5OaL3bjFSJcicqSx6PVuJ xprBnDCD8BKQp/8= Received: (qmail 105233 invoked by alias); 29 Mar 2016 13:27:56 -0000 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 Received: (qmail 105208 invoked by uid 89); 29 Mar 2016 13:27:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=thorough, thomascodesourcerycom, thomas@codesourcery.com, sk:torture X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 29 Mar 2016 13:27:45 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aktgL-0003sQ-NR from Thomas_Schwinge@mentor.com ; Tue, 29 Mar 2016 06:27:42 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Tue, 29 Mar 2016 14:27:40 +0100 From: Thomas Schwinge To: CC: Jakub Jelinek , Bernd Schmidt Subject: Re: Also test -O0 for OpenACC C, C++ offloading test cases In-Reply-To: <87wpora7gu.fsf@hertz.schwinge.homeip.net> References: <87mvpqrets.fsf@kepler.schwinge.homeip.net> <56F1CC9B.1060003@redhat.com> <87mvppbsgw.fsf@hertz.schwinge.homeip.net> <56F2E72E.9090104@redhat.com> <87wpora7gu.fsf@hertz.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Tue, 29 Mar 2016 15:27:36 +0200 Message-ID: <87mvph9zxz.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Thu, 24 Mar 2016 22:31:29 +0100, I wrote: > --- libgomp/testsuite/libgomp.oacc-c++/c++.exp > +++ libgomp/testsuite/libgomp.oacc-c++/c++.exp > # Initialize dg. > dg-init > +torture-init > > # Turn on OpenACC. > lappend ALWAYS_CFLAGS "additional_flags=-fopenacc" > @@ -104,7 +101,26 @@ if { $lang_test_file_found } { > > setenv ACC_DEVICE_TYPE $offload_target_openacc > > - dg-runtest $tests "$tagopt" "$libstdcxx_includes $DEFAULT_CFLAGS" > + # To get better test coverage for device-specific code that is only > + # ever used in offloading configurations, we'd like more thorough > + # testing for test cases that deal with offloading, which most of all > + # OpenACC test cases are. We enable torture testing, but limit it to > + # -O0 and -O2 only, to avoid testing times exploding too much, under > + # the assumption that between -O0 and -O[something] there is the > + # biggest difference in the overall structure of the generated code. > + switch $offload_target_openacc { > + host { > + set-torture-options [list \ > + { -O2 } ] > + } > + default { > + set-torture-options [list \ > + { -O0 } \ > + { -O2 } ] > + } > + } > + > + gcc-dg-runtest $tests "$tagopt" "$libstdcxx_includes" > } > } > > @@ -112,4 +128,5 @@ if { $lang_test_file_found } { > set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" > > # All done. > +torture-finish > dg-finish In a nvptx-none configuration (that is, without libstdc++), this caused: Running [...]/libgomp/testsuite/libgomp.oacc-c++/c++.exp ... +ERROR: tcl error sourcing [...]/libgomp/testsuite/libgomp.oacc-c++/c++.exp +ERROR: torture-finish: torture_without_loops is not defined + while executing +"error "torture-finish: torture_without_loops is not defined"" + invoked from within +"if [info exists torture_without_loops] { + unset torture_without_loops + } else { + error "torture-finish: torture_without_loops is not defined" + }" + (procedure "torture-finish" line 4) + invoked from within +"torture-finish" + (file "[...]/libgomp/testsuite/libgomp.oacc-c++/c++.exp" line 131) + invoked from within +"source [...]/libgomp/testsuite/libgomp.oacc-c++/c++.exp" + ("uplevel" body line 1) + invoked from within +"uplevel #0 source [...]/libgomp/testsuite/libgomp.oacc-c++/c++.exp" + invoked from within +"catch "uplevel #0 source $test_file_name"" Running [...]/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp ... torture_with_loops and torture_without_loops are set in gcc/testsuite/lib/torture-options.exp:set-torture-options -- which we don't call in libgomp.oacc-c++/c++.exp if skipping C++ testing. As obvious, fixed in r234519 as follows: commit 53c452eee566d997bdef3ee0b20e7bb4485d77a4 Author: tschwinge Date: Tue Mar 29 13:24:22 2016 +0000 Avoid ERROR in libgomp.oacc-c++/c++.exp in non-C++ configurations libgomp/ * testsuite/libgomp.oacc-c++/c++.exp [!lang_test_file_found]: Call set-torture-options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234519 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 5 +++++ libgomp/testsuite/libgomp.oacc-c++/c++.exp | 4 ++++ 2 files changed, 9 insertions(+) Grüße Thomas diff --git libgomp/ChangeLog libgomp/ChangeLog index e0cd567..f4f30fb 100644 --- libgomp/ChangeLog +++ libgomp/ChangeLog @@ -1,3 +1,8 @@ +2016-03-29 Thomas Schwinge + + * testsuite/libgomp.oacc-c++/c++.exp [!lang_test_file_found]: Call + set-torture-options. + 2016-03-24 Thomas Schwinge * testsuite/libgomp.oacc-c++/c++.exp: Set up torture testing, use diff --git libgomp/testsuite/libgomp.oacc-c++/c++.exp libgomp/testsuite/libgomp.oacc-c++/c++.exp index bbdbe2f..608b298 100644 --- libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -122,6 +122,10 @@ if { $lang_test_file_found } { gcc-dg-runtest $tests "$tagopt" "$libstdcxx_includes" } +} else { + # Call this once, which placates the subsequent torture-finish. + set-torture-options [list \ + { INVALID } ] } # See above.