+2016-03-24 Thomas Schwinge <thomas@codesourcery.com>
+
+ * 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 <mliska@suse.cz>
* plugin/plugin-hsa.c (packet_store_release): New function
load_lib libgomp-dg.exp
load_gcc_lib gcc-dg.exp
+load_gcc_lib torture-options.exp
global shlib_ext
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"
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"
}
}
set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST"
# All done.
+torture-finish
dg-finish
-/* { dg-additional-options "-O0" } */
+/* Test the acc_on_device library function. */
+/* { dg-additional-options "-fno-builtin-acc_on_device" } */
#include <openacc.h>
-/* acc_on_device might not be folded at -O0, but it should work. */
-
int main ()
{
int dev;
/* { dg-do compile } */
-/* { dg-additional-options "-O2" } */
+/* We don't expect this to work with optimizations disabled.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <openacc.h>
-/* { dg-additional-options "-O2 -fipa-pta" } */
+/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
-/* { dg-additional-options "-O2 -fipa-pta" } */
+/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
-/* { dg-additional-options "-O2 -fipa-pta" } */
+/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
-/* { 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 <stdio.h>
#include <openacc.h>
-
-/* { 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 <openacc.h>
#include <alloca.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
-/* { 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 <stdio.h>
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"
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