[testsuite, Fortran] Provide 'dg-compile-aux-modules' in 'gfortran.dg/goacc/goacc...
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 21 Mar 2019 19:44:34 +0000 (20:44 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Thu, 21 Mar 2019 19:44:34 +0000 (20:44 +0100)
..., as yet another copy from 'gfortran.dg/dg.exp', which there are a few
already.

gcc/testsuite/
* gfortran.dg/goacc/goacc.exp (dg-compile-aux-modules): New proc.

From-SVN: r269854

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/goacc/goacc.exp

index a5211cca6c6aed2cb3e90144afd34e1611b91822..1f2f3eba6f40431c000289b10616285b258e2681 100644 (file)
@@ -1,5 +1,7 @@
 2019-03-21  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * gfortran.dg/goacc/goacc.exp (dg-compile-aux-modules): New proc.
+
        PR fortran/56408
        * gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
        (dg-compile-aux-modules): Fix diagnostic.
index f1adb186a1e497a4f813675a824dc8e6a20d8331..1b093f6d41f5ec382697b754dee6291596bedc74 100644 (file)
@@ -28,6 +28,31 @@ if ![check_effective_target_fopenacc] {
 # Initialize `dg'.
 dg-init
 
+global gfortran_test_path
+global gfortran_aux_module_flags
+set gfortran_test_path $srcdir/$subdir
+set gfortran_aux_module_flags "-fopenacc"
+proc dg-compile-aux-modules { args } {
+    global gfortran_test_path
+    global gfortran_aux_module_flags
+    if { [llength $args] != 2 } {
+       error "dg-compile-aux-modules: needs one argument"
+       return
+    }
+
+    set level [info level]
+    if { [info procs dg-save-unknown] != [list] } {
+       rename dg-save-unknown dg-save-unknown-level-$level
+    }
+
+    dg-test $gfortran_test_path/[lindex $args 1] "" $gfortran_aux_module_flags
+    # cleanup-modules is intentionally not invoked here.
+
+    if { [info procs dg-save-unknown-level-$level] != [list] } {
+       rename dg-save-unknown-level-$level dg-save-unknown
+    }
+}
+
 # Main loop.
 gfortran-dg-runtest [lsort \
        [find $srcdir/$subdir *.\[fF\]{,90,95,03,08} ] ] "" "-fopenacc"