From patchwork Thu Mar 24 21:31:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 601815 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 3qWKQ95nwWz9sCk for ; Fri, 25 Mar 2016 08:31:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=mguCCLXV; 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=Jg6wjparoEkLB0I8Vdy86I8S8cflRoLXepZfFx9caUF/0Alnd3djt znY1Vp930vwmxpK3dx7oA51ZFz1VCP8L9BAPDNg/5oRx/PE/FaPvskUkI1pwKH/L JxEXXTSTG+qhow9fxnolRrxMwVXKSI1nMDb0TBRPYOjx0QghHlG7G8= 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=hal6wn6n3w9WtxUBOnfUFyFQIBY=; b=mguCCLXV2oJdDTUdLn9WT+DRIlJU wsFVVsqMNFsIecU8OWn1ACYIHVgzu0PyeB7swHA+5B7MWh9l0cVfrIzRaoi0jLJ8 rEvLJgc5ns+/09F6NiofTixO4FPzXHKO3e2FRGAoIjlalp3aB8tEhh1MMTunwvF0 vUYsi7c7Blcoppo= Received: (qmail 91459 invoked by alias); 24 Mar 2016 21:31:51 -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 91439 invoked by uid 89); 24 Mar 2016 21:31:50 -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=configurations, UD:c.exp, c.exp, cexp 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; Thu, 24 Mar 2016 21:31:40 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ajCqv-000544-A5 from Thomas_Schwinge@mentor.com ; Thu, 24 Mar 2016 14:31:37 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 24 Mar 2016 21:31:34 +0000 From: Thomas Schwinge To: Bernd Schmidt CC: , Jakub Jelinek , Nathan Sidwell Subject: Re: Also test -O0 for OpenACC C, C++ offloading test cases In-Reply-To: <56F2E72E.9090104@redhat.com> References: <87mvpqrets.fsf@kepler.schwinge.homeip.net> <56F1CC9B.1060003@redhat.com> <87mvppbsgw.fsf@hertz.schwinge.homeip.net> <56F2E72E.9090104@redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 24 Mar 2016 22:31:29 +0100 Message-ID: <87wpora7gu.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Wed, 23 Mar 2016 19:57:50 +0100, Bernd Schmidt wrote: > Ok with [...]. Thanks for the review; committed in r234471: commit 02662647911b3296b07d7f4e3e3ed0200619da48 Author: tschwinge Date: Thu Mar 24 21:29:55 2016 +0000 Also test -O0 for OpenACC C, C++ offloading test cases libgomp/ * testsuite/libgomp.oacc-c++/c++.exp: Set up torture testing, use gcc-dg-runtest. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c: Specify -fno-builtin-acc_on_device instead of -O0. * testsuite/libgomp.oacc-c-c++-common/acc-on-device.c: Skip for -O0. * testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c: Don't specify -O2. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234471 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 36 ++++++++++++++++++++++ libgomp/testsuite/libgomp.oacc-c++/c++.exp | 29 +++++++++++++---- .../libgomp.oacc-c-c++-common/acc-on-device-2.c | 5 ++- .../libgomp.oacc-c-c++-common/acc-on-device.c | 3 +- .../kernels-alias-ipa-pta-2.c | 2 +- .../kernels-alias-ipa-pta-3.c | 2 +- .../kernels-alias-ipa-pta.c | 2 +- .../libgomp.oacc-c-c++-common/loop-auto-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-dim-default.c | 6 ++-- .../testsuite/libgomp.oacc-c-c++-common/loop-g-1.c | 5 +-- .../testsuite/libgomp.oacc-c-c++-common/loop-g-2.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-gwv-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-red-g-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-red-gwv-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-red-v-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-red-v-2.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-red-w-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-red-w-2.c | 5 +-- .../testsuite/libgomp.oacc-c-c++-common/loop-v-1.c | 5 +-- .../testsuite/libgomp.oacc-c-c++-common/loop-w-1.c | 5 +-- .../libgomp.oacc-c-c++-common/loop-wv-1.c | 5 +-- .../libgomp.oacc-c-c++-common/routine-g-1.c | 5 +-- .../libgomp.oacc-c-c++-common/routine-gwv-1.c | 5 +-- .../libgomp.oacc-c-c++-common/routine-v-1.c | 5 +-- .../libgomp.oacc-c-c++-common/routine-w-1.c | 5 +-- .../libgomp.oacc-c-c++-common/routine-wv-1.c | 5 +-- libgomp/testsuite/libgomp.oacc-c/c.exp | 29 +++++++++++++---- 27 files changed, 147 insertions(+), 57 deletions(-) Grüße Thomas diff --git libgomp/ChangeLog libgomp/ChangeLog index 5f2c401..e0cd567 100644 --- libgomp/ChangeLog +++ libgomp/ChangeLog @@ -1,3 +1,39 @@ +2016-03-24 Thomas Schwinge + + * testsuite/libgomp.oacc-c++/c++.exp: Set up torture testing, use + gcc-dg-runtest. + * testsuite/libgomp.oacc-c/c.exp: Likewise. + * testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c: Specify + -fno-builtin-acc_on_device instead of -O0. + * testsuite/libgomp.oacc-c-c++-common/acc-on-device.c: Skip for + -O0. + * testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: + Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: Likewise. + * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c: + Don't specify -O2. + * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c: + Likewise. + * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c: + Likewise. + 2016-03-24 Martin Liska * plugin/plugin-hsa.c (packet_store_release): New function diff --git libgomp/testsuite/libgomp.oacc-c++/c++.exp libgomp/testsuite/libgomp.oacc-c++/c++.exp index 88b0269..bbdbe2f 100644 --- libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -2,6 +2,7 @@ load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp +load_gcc_lib torture-options.exp global shlib_ext @@ -13,13 +14,9 @@ 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 { - set DEFAULT_CFLAGS "-O2" -} - # 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 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c index e5d9c36..bfcb67d 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c @@ -1,9 +1,8 @@ -/* { dg-additional-options "-O0" } */ +/* Test the acc_on_device library function. */ +/* { dg-additional-options "-fno-builtin-acc_on_device" } */ #include -/* acc_on_device might not be folded at -O0, but it should work. */ - int main () { int dev; diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c index 88c000e..e0d8710 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-additional-options "-O2" } */ +/* We don't expect this to work with optimizations disabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c index 0f323c8..e8d65df 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-O2 -fipa-pta" } */ +/* { dg-additional-options "-fipa-pta" } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c index 654e750..dd8ca87 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-O2 -fipa-pta" } */ +/* { dg-additional-options "-fipa-pta" } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c index 44d4fd2..50e7dc1 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-O2 -fipa-pta" } */ +/* { dg-additional-options "-fipa-pta" } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c index 4922c9c..622bbdf 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c index 36b882f..c433b80 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c @@ -1,5 +1,7 @@ - -/* { dg-additional-options "-O2 -fopenacc-dim=16:16" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-additional-options "-fopenacc-dim=16:16" } */ #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c index 23c2a75..7bff6cd 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c index 1a93db3..92b82a0 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c index 26b2df9..42b612a 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c index c14bddd..a8684f95 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c index 3de8b09..3b104cf 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c index bae5c66..b77ae76 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c index ada92e3..16d8f9f 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c index 706d0d8..9cc12b3 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c index a073ac8..f0c9d81 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c index b9ec95b..2974807 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c index 539e41d..33b6eae 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c index fcb9079..578cfad 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c index 201dc72..9d14c3b 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c index 8fc4cb5..ace2f49 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c index fefeb93..2503e8d 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c index 01d1dc8..80cd462 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c index bd9f1df..5e45fad 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* This code uses nvptx inline assembly guarded with acc_on_device, which is + not optimized away at -O0, and then confuses the target assembler. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ #include diff --git libgomp/testsuite/libgomp.oacc-c/c.exp libgomp/testsuite/libgomp.oacc-c/c.exp index 5020e6a..b509a10 100644 --- libgomp/testsuite/libgomp.oacc-c/c.exp +++ libgomp/testsuite/libgomp.oacc-c/c.exp @@ -13,14 +13,11 @@ if [info exists lang_include_flags] then { load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp - -# If a testcase doesn't have special options, use these. -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS "-O2" -} +load_gcc_lib torture-options.exp # Initialize dg. dg-init +torture-init # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=-fopenacc" @@ -67,8 +64,28 @@ foreach offload_target_openacc $offload_targets_s_openacc { setenv ACC_DEVICE_TYPE $offload_target_openacc - dg-runtest $tests "$tagopt" $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" "" } # All done. +torture-finish dg-finish