aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-11-27 18:50:55 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-11-27 18:50:55 +0100
commitb1a73b489462df2a1edaf39ec10dc03e0963d516 (patch)
treee665beb39196b4f680f1082422acdb88f5295ad3 /libgomp
parentfa21363375a2ff71ded325e6debe890e561a9743 (diff)
downloadgcc-b1a73b489462df2a1edaf39ec10dc03e0963d516.zip
gcc-b1a73b489462df2a1edaf39ec10dc03e0963d516.tar.gz
gcc-b1a73b489462df2a1edaf39ec10dc03e0963d516.tar.bz2
Fix 'libgomp.fortran/target-print-1.f90', 'libgomp.oacc-fortran/print-1.f90' for offload target nvptx
libgomp/ * testsuite/lib/libgomp.exp (check_effective_target_offload_target_nvptx): New proc. * testsuite/libgomp.fortran/target-print-1.f90: Use it with 'dg-skip-if'. * testsuite/libgomp.oacc-fortran/print-1.f90: Likewise. * testsuite/libgomp.fortran/target-print-1-nvptx.f90: New file. * testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Likewise. From-SVN: r278779
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog10
-rw-r--r--libgomp/testsuite/lib/libgomp.exp21
-rw-r--r--libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f9011
-rw-r--r--libgomp/testsuite/libgomp.fortran/target-print-1.f906
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f9011
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/print-1.f906
6 files changed, 61 insertions, 4 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 6547830..d8d76ba 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,13 @@
+2019-11-27 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/lib/libgomp.exp
+ (check_effective_target_offload_target_nvptx): New proc.
+ * testsuite/libgomp.fortran/target-print-1.f90: Use it with
+ 'dg-skip-if'.
+ * testsuite/libgomp.oacc-fortran/print-1.f90: Likewise.
+ * testsuite/libgomp.fortran/target-print-1-nvptx.f90: New file.
+ * testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Likewise.
+
2019-11-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/libgomp.c/pr39591-1.c: Rename err to e.
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 74d0326..06e3186 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -336,6 +336,27 @@ proc offload_target_to_openacc_device_type { offload_target } {
}
}
+# Return 1 if compiling for offload target nvptx.
+proc check_effective_target_offload_target_nvptx { } {
+ # Consider all actual options, including the flags passed to
+ # 'gcc-dg-runtest', or 'gfortran-dg-runtest' (see the 'libgomp.*/*.exp'
+ # files; in particular, '-foffload', 'libgomp.oacc-*/*.exp'), which don't
+ # get passed on to 'check_effective_target_*' functions. (Not caching the
+ # result due to that.)
+ set options [current_compiler_flags]
+ # Instead of inspecting command-line options, look what the compiler driver
+ # decides. This is somewhat modelled after
+ # 'gcc/testsuite/lib/target-supports.exp:check_configured_with'.
+ set gcc_output [libgomp_target_compile "-v $options" "" "none" ""]
+ if [regexp "(?n)^OFFLOAD_TARGET_NAMES=(.*)" $gcc_output dummy offload_targets] {
+ verbose "compiling for offload targets: $offload_targets"
+ return [string match "*:nvptx*:*" ":$offload_targets:"]
+ }
+
+ verbose "not compiling for any offload targets"
+ return 0
+}
+
# Return 1 if offload device is available.
proc check_effective_target_offload_device { } {
return [check_runtime_nocache offload_device_available_ {
diff --git a/libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f90 b/libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f90
new file mode 100644
index 0000000..a89c9c3
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f90
@@ -0,0 +1,11 @@
+! Ensure that write on the offload device works, nvptx offloading variant.
+
+! This doesn't compile: for nvptx offloading we're using a minimal libgfortran
+! configuration.
+! { dg-do link } ! ..., but still apply 'dg-do run' options.
+! { dg-xfail-if "minimal libgfortran" { offload_target_nvptx } }
+
+! Skip duplicated testing.
+! { dg-skip-if "separate file" { ! offload_target_nvptx } }
+
+include 'target-print-1.f90'
diff --git a/libgomp/testsuite/libgomp.fortran/target-print-1.f90 b/libgomp/testsuite/libgomp.fortran/target-print-1.f90
index c71a095..327bb22 100644
--- a/libgomp/testsuite/libgomp.fortran/target-print-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/target-print-1.f90
@@ -1,8 +1,10 @@
-! Ensure that printf on the offload device works.
+! Ensure that write on the offload device works.
! { dg-do run }
! { dg-output "The answer is 42(\n|\r\n|\r)+" }
-! { dg-xfail-if "no write for nvidia" { openacc_nvidia_accel_selected } }
+
+! Separate file 'target-print-1-nvptx.f90' for nvptx offloading.
+! { dg-skip-if "separate file" { offload_target_nvptx } }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f90 b/libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f90
new file mode 100644
index 0000000..866c865
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f90
@@ -0,0 +1,11 @@
+! Ensure that write on the offload device works, nvptx offloading variant.
+
+! This doesn't compile: for nvptx offloading we're using a minimal libgfortran
+! configuration.
+! { dg-do link } ! ..., but still apply 'dg-do run' options.
+! { dg-xfail-if "minimal libgfortran" { offload_target_nvptx } }
+
+! Skip duplicated testing.
+! { dg-skip-if "separate file" { ! offload_target_nvptx } }
+
+include 'print-1.f90'
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/print-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/print-1.f90
index a83280d..7b7f737 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/print-1.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/print-1.f90
@@ -1,8 +1,10 @@
-! Ensure that printf on the offload device works.
+! Ensure that write on the offload device works.
! { dg-do run }
! { dg-output "The answer is 42(\n|\r\n|\r)+" }
-! { dg-xfail-if "no write for nvidia" { openacc_nvidia_accel_selected } }
+
+! Separate file 'print-1-nvptx.f90' for nvptx offloading.
+! { dg-skip-if "separate file" { offload_target_nvptx } }
program main
implicit none