From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107801 invoked by alias); 1 Apr 2016 08:56:18 -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 107642 invoked by uid 89); 1 Apr 2016 08:56:14 -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=U*gomp-4_0-branch, sk:gomp4_, sk:gomp-4_, 234469 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; Fri, 01 Apr 2016 08:55:58 +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 1alury-0003UR-C3 from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Fri, 01 Apr 2016 01:55:55 -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; Fri, 1 Apr 2016 09:55:53 +0100 From: Thomas Schwinge To: Subject: [gomp4] 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: Fri, 01 Apr 2016 08:56:00 -0000 Message-ID: <8737r5aesq.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-04/txt/msg00008.txt.bz2 Hi! On Thu, 24 Mar 2016 22:31:29 +0100, I wrote: > On Wed, 23 Mar 2016 19:57:50 +0100, Bernd Schmidt w= rote: > > Ok with [...]. >=20 > Thanks for the review; committed in r234471: > Also test -O0 for OpenACC C, C++ offloading test cases Merged into gomp-4_0-branch in r234664: commit 9973610b0d5cb41f380fa18eabacb5f967fe4d0e Merge: e252cf1 0266264 Author: tschwinge Date: Fri Apr 1 08:41:44 2016 +0000 svn merge -r 234469:234471 svn+ssh://gcc.gnu.org/svn/gcc/trunk =20=20=20=20 =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@2346= 64 138bc75d-0d04-0410-961f-82ee72b054a4 libgomp/ChangeLog | 36 ++++++++++++++ libgomp/testsuite/libgomp.oacc-c++/c++.exp | 55 +++++++++---------= ---- .../libgomp.oacc-c-c++-common/acc-on-device-2.c | 5 +- .../libgomp.oacc-c-c++-common/acc-on-device.c | 3 +- .../libgomp.oacc-c-c++-common/avoid-offloading-1.c | 3 ++ .../libgomp.oacc-c-c++-common/avoid-offloading-2.c | 3 ++ .../libgomp.oacc-c-c++-common/gang-static-2.c | 4 +- .../libgomp.oacc-c-c++-common/host_data-1.c | 1 + libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c | 2 + .../libgomp.oacc-c-c++-common/loop-auto-1.c | 6 ++- .../loop-default-compile.c | 6 ++- .../loop-default-runtime.c | 6 ++- .../testsuite/libgomp.oacc-c-c++-common/loop-g-1.c | 6 ++- .../testsuite/libgomp.oacc-c-c++-common/loop-g-2.c | 6 ++- .../libgomp.oacc-c-c++-common/loop-gwv-1.c | 5 +- .../libgomp.oacc-c-c++-common/loop-red-g-1.c | 6 ++- .../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 | 6 ++- .../libgomp.oacc-c-c++-common/loop-red-w-2.c | 6 ++- .../libgomp.oacc-c-c++-common/loop-red-wv-1.c | 5 +- .../testsuite/libgomp.oacc-c-c++-common/loop-v-1.c | 5 +- .../testsuite/libgomp.oacc-c-c++-common/loop-w-1.c | 6 ++- .../libgomp.oacc-c-c++-common/loop-wv-1.c | 5 +- .../libgomp.oacc-c-c++-common/routine-3.c | 8 ++-- .../libgomp.oacc-c-c++-common/routine-g-1.c | 6 ++- .../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-vec-1.c | 5 +- .../libgomp.oacc-c-c++-common/routine-w-1.c | 6 ++- .../libgomp.oacc-c-c++-common/routine-work-1.c | 6 ++- .../libgomp.oacc-c-c++-common/routine-wv-1.c | 5 +- .../libgomp.oacc-c-c++-common/routine-wv-2.c | 5 +- .../libgomp.oacc-c-c++-common/worker-partn-8.c | 2 - libgomp/testsuite/libgomp.oacc-c/c.exp | 54 +++++++++---------= --- 36 files changed, 187 insertions(+), 121 deletions(-) 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 =20 * plugin/plugin-hsa.c (packet_store_release): New function diff --git libgomp/testsuite/libgomp.oacc-c++/c++.exp libgomp/testsuite/lib= gomp.oacc-c++/c++.exp index f513d87..5a07d6a 100644 --- libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -1,14 +1,8 @@ # This whole file adapted from libgomp.c++/c++.exp. =20 -# To avoid testing time exploding too much, limit any torture testing to -= O0 -# and -O2 only, under the assumption that between -O0 and -O[something] th= ere -# is the biggest difference in the overall structure of the generated code. -set TORTURE_OPTIONS [list \ - { -O0 } \ - { -O2 } ] - load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp +load_gcc_lib torture-options.exp =20 global shlib_ext =20 @@ -20,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" @@ -64,22 +54,6 @@ if { $lang_test_file_found } { set tests [lsort [concat \ [find $srcdir/$subdir *.C] \ [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]] - # To get better test coverage for device-specific code that is only ev= er - # used in offloading configurations, we'd like more thorough (torture) - # testing for test cases that are dealing with the specifics of - # gang/worker/vector single/redundant/partitioned modes. They're sele= cted - # based on their file names -- not a perfect property to detect such t= est - # cases, but should be sufficient. - set ttests [lsort -unique [concat \ - [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *gang*.c] \ - [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *worker*.c] \ - [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *vec*.c]]] - # tests :=3D tests - ttests. - foreach t $ttests { - set i [lsearch -exact $tests $t] - set tests [lreplace $tests $i $i] - } - =20 if { $blddir !=3D "" } { set ld_library_path "$always_ld_library_path:${blddir}/${lang_libr= ary_path}" @@ -130,15 +104,32 @@ if { $lang_test_file_found } { } set tagopt "$tagopt -DACC_MEM_SHARED=3D$acc_mem_shared -foffload=3D$offlo= ad_target_openacc" =20 - dg-runtest $tests "$tagopt" "$libstdcxx_includes $DEFAULT_CFLAGS" - gcc-dg-runtest $ttests "$tagopt" "$libstdcxx_includes" + # 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 -glob $offload_target_openacc { + disable { + set-torture-options [list \ + { -O2 } ] + } + default { + set-torture-options [list \ + { -O0 } \ + { -O2 } ] + } + } + + gcc-dg-runtest $tests "$tagopt" "$libstdcxx_includes" } } =20 # See above. set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" =20 -unset TORTURE_OPTIONS - # 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/avoid-offloading-1.c= libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-1.c index 2037484..8f50ba3 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-1.c @@ -1,5 +1,8 @@ /* Test that the compiler decides to "avoid offloading". */ =20 +/* The warning is only triggered for -O2 and higher. + { dg-xfail-if "n/a" { openacc_nvidia_accel_selected } { "-O0" "-O1" } {= "" } } */ + #include =20 int main(void) diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-2.c= libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-2.c index ee30aa6..41bd6d5 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/avoid-offloading-2.c @@ -1,6 +1,9 @@ /* Test that a user can override the compiler's "avoid offloading" decision. */ =20 +/* The warning is only triggered for -O2 and higher. + { dg-xfail-if "n/a" { openacc_nvidia_accel_selected } { "-O0" "-O1" } {= "" } } */ + #include =20 int main(void) diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c libg= omp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c index 20a866d..ce9632c 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c @@ -1,5 +1,7 @@ /* { dg-do run { target openacc_nvidia_accel_selected } } */ -/* { 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" } { "" } } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-1.c libgom= p/testsuite/libgomp.oacc-c-c++-common/host_data-1.c index 51745ba..b97d877 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-1.c @@ -1,5 +1,6 @@ /* { dg-do run { target openacc_nvidia_accel_selected } } */ /* { dg-additional-options "-lcuda -lcublas -lcudart" } */ +/* { dg-xfail-run-if "TODO" { *-*-* } { "-O0" } { "" } } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c libgomp/tests= uite/libgomp.oacc-c-c++-common/if-1.c index 5398905..ade064d 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c @@ -1,3 +1,5 @@ +/* { dg-xfail-run-if "TODO" { *-*-* } { "-O0" } { "" } } */ + #include #include #include 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 7081fe1..0248ad7 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 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-compile= .c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-compile.c index 640d827..ec3ca52 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-compile.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-compile.c @@ -1,5 +1,7 @@ - -/* { dg-additional-options "-O2 -fopenacc-dim=3D16:16" } */ +/* { dg-additional-options "-fopenacc-dim=3D16: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" } { "" } } */ =20 #include "loop-default.h" #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-runtime= .c libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-runtime.c index 79ab468..e61203d 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-runtime.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-default-runtime.c @@ -1,5 +1,7 @@ - -/* { dg-additional-options "-O2 -fopenacc-dim=3D-:-" } */ +/* { dg-additional-options "-fopenacc-dim=3D-:-" } */ +/* 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" } { "" } } */ =20 #include "loop-default.h" #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 7afb89b..c7b43b7 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =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 db83692..6c4c0d2 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =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..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" } { "" } } */ =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 129a8c8..6b86de6 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =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..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" } { "" } } */ =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..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" } { "" } } */ =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..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" } { "" } } */ =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 fadf7d5..8b4dc45 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =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 68d3d7a..174a3ff 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c libg= omp/testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c index 398b7cc..eeeb1d7 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-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" } { "" } } */ =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..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" } { "" } } */ =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 28c6d0b..34c00a3 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =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..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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-3.c libgomp/= testsuite/libgomp.oacc-c-c++-common/routine-3.c index a191758..2cdd6bf 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-3.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-3.c @@ -1,6 +1,8 @@ - -/* { dg-do run } */ -/* { dg-xfail-if "foo not found" { openacc_host_selected } } */ +/* At -O0, we do get the expected "undefined reference to `foo'" link-time + error message (but the check needs to be done differently; compare to + routine-nohost-1.c), but for -O2 we don't; presumably because the funct= ion + gets inlined. + { dg-xfail-if "TODO" { *-*-* } { "-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 d38917b..33c8a62 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =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..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" } { "" } } */ =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..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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-vec-1.c libg= omp/testsuite/libgomp.oacc-c-c++-common/routine-vec-1.c index 8cbd2e7..fa1f96d 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-vec-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-vec-1.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O1" } */ +/* 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" } { "" } } */ =20 #include #include 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 f21c0a2..c295e66 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,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O2 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-work-1.c lib= gomp/testsuite/libgomp.oacc-c-c++-common/routine-work-1.c index a92cafc..daf9bea 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-work-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-work-1.c @@ -1,5 +1,7 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O1 -w" } */ +/* { dg-additional-options "-w" } */ +/* 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" } { "" } } */ =20 #include #include 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..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" } { "" } } */ =20 #include =20 diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c libgo= mp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c index 6d0b455..b5cbc90 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c @@ -1,5 +1,6 @@ -/* { dg-do run } */ -/* { dg-additional-options "-O1" } */ +/* 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" } { "" } } */ =20 #include #include diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/worker-partn-8.c lib= gomp/testsuite/libgomp.oacc-c-c++-common/worker-partn-8.c index e787947..6ed736a 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/worker-partn-8.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/worker-partn-8.c @@ -1,5 +1,3 @@ -/* { dg-additional-options "-O0" } */ - /* With -O0, variables are on the stack, not in registers. Check that wor= ker state propagation handles the stack frame. */ =20 diff --git libgomp/testsuite/libgomp.oacc-c/c.exp libgomp/testsuite/libgomp= .oacc-c/c.exp index 03fe3a4..e4be086 100644 --- libgomp/testsuite/libgomp.oacc-c/c.exp +++ libgomp/testsuite/libgomp.oacc-c/c.exp @@ -11,23 +11,13 @@ if [info exists lang_include_flags] then { unset lang_include_flags } =20 -# To avoid testing time exploding too much, limit any torture testing to -= O0 -# and -O2 only, under the assumption that between -O0 and -O[something] th= ere -# is the biggest difference in the overall structure of the generated code. -set TORTURE_OPTIONS [list \ - { -O0 } \ - { -O2 } ] - 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" @@ -36,21 +26,6 @@ lappend ALWAYS_CFLAGS "additional_flags=3D-fopenacc" set tests [lsort [concat \ [find $srcdir/$subdir *.c] \ [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]] -# To get better test coverage for device-specific code that is only ever -# used in offloading configurations, we'd like more thorough (torture) -# testing for test cases that are dealing with the specifics of -# gang/worker/vector single/redundant/partitioned modes. They're selected -# based on their file names -- not a perfect property to detect such test -# cases, but should be sufficient. -set ttests [lsort -unique [concat \ - [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *gang*.c] \ - [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *worker*.c] \ - [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *vec*.c]]] -# tests :=3D tests - ttests. -foreach t $ttests { - set i [lsearch -exact $tests $t] - set tests [lreplace $tests $i $i] -} =20 set ld_library_path $always_ld_library_path append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] @@ -90,11 +65,28 @@ foreach offload_target_openacc $offload_targets_s_opena= cc { } set tagopt "$tagopt -DACC_MEM_SHARED=3D$acc_mem_shared -foffload=3D$of= fload_target_openacc" =20 - dg-runtest $tests "$tagopt" $DEFAULT_CFLAGS - gcc-dg-runtest $ttests "$tagopt" "" -} + # 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 -glob $offload_target_openacc { + disable { + set-torture-options [list \ + { -O2 } ] + } + default { + set-torture-options [list \ + { -O0 } \ + { -O2 } ] + } + } =20 -unset TORTURE_OPTIONS + gcc-dg-runtest $tests "$tagopt" "" +} =20 # All done. +torture-finish dg-finish Gr=C3=BC=C3=9Fe Thomas