From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105856 invoked by alias); 22 Mar 2016 11:58:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 105744 invoked by uid 89); 22 Mar 2016 11:58:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=1314, offloading, H*RU:sk:smtprel, Hx-spam-relays-external:sk:smtprel X-HELO: smtprelay05.ispgateway.de Received: from smtprelay05.ispgateway.de (HELO smtprelay05.ispgateway.de) (80.67.31.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 22 Mar 2016 11:58:29 +0000 Received: from [217.247.200.18] (helo=kepler.schwinge.homeip.net) by smtprelay05.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1aiKx7-0007Vy-49 for gcc-patches@gcc.gnu.org; Tue, 22 Mar 2016 12:58:25 +0100 Received: (nullmailer pid 14961 invoked by uid 1000); Tue, 22 Mar 2016 11:58:23 -0000 From: Thomas Schwinge To: gcc-patches@gcc.gnu.org, Jakub Jelinek Subject: Also test -O0 for OpenACC C, C++ offloading test cases User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Tue, 22 Mar 2016 12:14:00 -0000 Message-ID: <87mvpqrets.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Df-Sender: b3V0Z29pbmdAc2Nod2luZ2UubmFtZQ== X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg01240.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 20743 Hi! As discussed in (and similar to what we're already doing for Fortran, and similar to what recently got committed to libgomp/testsuite/libgomp.hsa.c/c.exp), it has been helpful to also run C, C++ offloading test cases with -O0 in addition to the -O2 default. Making my earlier gomp-4_0-branch patch conceptually simpler, I came up with the following; OK for trunk? commit 879c8f6dcb9dad514fb3bf11c721fed37b6574be Author: Thomas Schwinge Date: Tue Mar 22 10:26:19 2016 +0100 Also test -O0 for OpenACC C, C++ offloading test cases =20=20=20=20 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. --- 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 | 4 ++- .../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 +++++++++++++++++-= ---- 26 files changed, 111 insertions(+), 56 deletions(-) diff --git libgomp/testsuite/libgomp.oacc-c++/c++.exp libgomp/testsuite/lib= gomp.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 @@ =20 load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp +load_gcc_lib torture-options.exp =20 global shlib_ext =20 @@ -13,13 +14,9 @@ if [info exists lang_include_flags] then { unset lang_include_flags } =20 -# 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 =20 # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=3D-fopenacc" @@ -104,7 +101,26 @@ if { $lang_test_file_found } { =20 setenv ACC_DEVICE_TYPE $offload_target_openacc =20 - 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" } } =20 @@ -112,4 +128,5 @@ if { $lang_test_file_found } { set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" =20 # All done. +torture-finish dg-finish diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c li= bgomp/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" } */ =20 #include =20 -/* 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 libg= omp/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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pt= a-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" } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pt= a-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" } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pt= a.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" } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c index 4922c9c..e44d26e 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,7 @@ /* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c l= ibgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c index 36b882f..80e4363 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=3D16:16" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-additional-options "-fopenacc-dim=3D16:16" } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-g-1.c index 23c2a75..0c8e9ff 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-g-2.c index 1a93db3..2316ce3 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 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..e05573f 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c index c14bddd..17a27b1 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c lib= gomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c index 3de8b09..4566568 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c index bae5c66..94c752f 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c index ada92e3..3c8b4b8 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c index 706d0d8..7616b19 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c index a073ac8..5f0a439 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-v-1.c index b9ec95b..cdba658 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-w-1.c index 539e41d..a65d535 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 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..df1a9fc 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c index 201dc72..b30424f 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c libg= omp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c index 8fc4cb5..b1cdfd0 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c index fefeb93..c49f643 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c index 01d1dc8..5806cb3 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c index bd9f1df..49761ce 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 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 { =20 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 =20 # Initialize dg. dg-init +torture-init =20 # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=3D-fopenacc" @@ -67,8 +64,28 @@ foreach offload_target_openacc $offload_targets_s_openac= c { =20 setenv ACC_DEVICE_TYPE $offload_target_openacc =20 - 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" "" } =20 # All done. +torture-finish dg-finish Gr=C3=BC=C3=9Fe Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJW8R06AAoJEK3/DN1sMFFtf80H/0ebLG/SsqeAaXr/bNETPOEY M//HCiHGbUlVp/8OsHicagylBYes4jNZLmUMj3h9/dur9WllJVJBzE1xxBlkWz3M hZ1X1EM7PL8dHVMDHbFo4OtbJfxFA2TXoG2ycVN9I5vfCmg4lYUSiWEy4TmG2JzL Opm/SpCJ2anlezqatQk8xwV6GpcdiTCO6oyY/jj8dJiM9T2AqSOSRSGqscKvf0iR JNy6L4rwqbc9AsG1cnQaBeyg4FZYMRbufUbMvC5eHAyzcDxkQAjrys+hF4jIZKJw FLBxOSqJmDj4mq8bYB982hqha4gRVf5MpHpinN1N50MC4EdF6TDv/iAjwnHLVPM= =IvuH -----END PGP SIGNATURE----- --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117183 invoked by alias); 22 Mar 2016 12:32:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 117172 invoked by uid 89); 22 Mar 2016 12:32:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=1314, H*r:Tue, offloading, 1,6 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, 22 Mar 2016 12:32:15 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1aiLTn-0002mF-S8 from Thomas_Schwinge@mentor.com ; Tue, 22 Mar 2016 05:32:11 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Tue, 22 Mar 2016 03:23:54 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 49CB5C2424; Tue, 22 Mar 2016 03:23:54 -0700 (PDT) From: Thomas Schwinge To: , Jakub Jelinek Subject: Also test -O0 for OpenACC C, C++ offloading test cases User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Tue, 22 Mar 2016 13:04:00 -0000 Message-ID: <87mvpqrets.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2016-03/txt/msg01242.txt.bz2 Message-ID: <20160322130400.OnUBatei6t9QV7eQG59Ig0a3ivyU_LfveH3jQFb7lcw@z> --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 20743 Hi! As discussed in (and similar to what we're already doing for Fortran, and similar to what recently got committed to libgomp/testsuite/libgomp.hsa.c/c.exp), it has been helpful to also run C, C++ offloading test cases with -O0 in addition to the -O2 default. Making my earlier gomp-4_0-branch patch conceptually simpler, I came up with the following; OK for trunk? commit 879c8f6dcb9dad514fb3bf11c721fed37b6574be Author: Thomas Schwinge Date: Tue Mar 22 10:26:19 2016 +0100 Also test -O0 for OpenACC C, C++ offloading test cases =20=20=20=20 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. --- 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 | 4 ++- .../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 +++++++++++++++++-= ---- 26 files changed, 111 insertions(+), 56 deletions(-) diff --git libgomp/testsuite/libgomp.oacc-c++/c++.exp libgomp/testsuite/lib= gomp.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 @@ =20 load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp +load_gcc_lib torture-options.exp =20 global shlib_ext =20 @@ -13,13 +14,9 @@ if [info exists lang_include_flags] then { unset lang_include_flags } =20 -# 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 =20 # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=3D-fopenacc" @@ -104,7 +101,26 @@ if { $lang_test_file_found } { =20 setenv ACC_DEVICE_TYPE $offload_target_openacc =20 - 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" } } =20 @@ -112,4 +128,5 @@ if { $lang_test_file_found } { set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" =20 # All done. +torture-finish dg-finish diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c li= bgomp/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" } */ =20 #include =20 -/* 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 libg= omp/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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pt= a-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" } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pt= a-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" } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pt= a.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" } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c index 4922c9c..e44d26e 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,7 @@ /* { dg-do run } */ -/* { dg-additional-options "-O2" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c l= ibgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c index 36b882f..80e4363 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=3D16:16" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-additional-options "-fopenacc-dim=3D16:16" } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-g-1.c index 23c2a75..0c8e9ff 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-g-2.c index 1a93db3..2316ce3 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 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..e05573f 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c index c14bddd..17a27b1 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c lib= gomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c index 3de8b09..4566568 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c index bae5c66..94c752f 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c index ada92e3..3c8b4b8 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c index 706d0d8..7616b19 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c index a073ac8..5f0a439 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-v-1.c index b9ec95b..cdba658 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/loop-w-1.c index 539e41d..a65d535 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 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..df1a9fc 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c index 201dc72..b30424f 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c libg= omp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c index 8fc4cb5..b1cdfd0 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c index fefeb93..c49f643 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c index 01d1dc8..5806cb3 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c index bd9f1df..49761ce 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" } */ +/* Dead code elimination for blocks guarded by acc_on_device () only works= with + optimizations enabled. + { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ =20 #include =20 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 { =20 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 =20 # Initialize dg. dg-init +torture-init =20 # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=3D-fopenacc" @@ -67,8 +64,28 @@ foreach offload_target_openacc $offload_targets_s_openac= c { =20 setenv ACC_DEVICE_TYPE $offload_target_openacc =20 - 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" "" } =20 # All done. +torture-finish dg-finish Gr=C3=BC=C3=9Fe Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJW8R0wAAoJEK3/DN1sMFFt/CoH/A6k8nG8qqONmjZ9XPASoN51 klXtRX+Tt0gmkfsdEJXxgP4ieYvWLE2hcACT4pPhanhbqFpUMLSgzcqIPHVvjnUp C6ZGuZiTR6lm/Lb7CdNznaYnr8+HO/p66WWEtLRUTPEXOXzOJVPlCERultYR14eB nnqVi8k7QL1WsfPFRzjDmI/FOqPW6Y545T3sKgBokUQ0VUb1BINNaLuBTZK7e/9j f7HDu/RBXjFwDKJ5Zq4TJi3lvZU8oISF+coLkobbCpCVDvk4Qc1CedPtDAtYXEQQ HtnmDQui6X/fZpnxCITMtRUaFBh+1aOyrBs/o30Np+8KfPzyjRxQuis/CfGygZQ= =gld3 -----END PGP SIGNATURE----- --=-=-=--