From f2c4627045e70a6f6c52914cf6334392aca75230 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 28 Feb 2019 17:45:13 +0100 Subject: [PATCH 1/2] [testsuite, Fortran] Provide 'dg-compile-aux-modules' in 'gfortran.dg/goacc/goacc.exp' ..., 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. --- gcc/testsuite/gfortran.dg/goacc/goacc.exp | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gcc/testsuite/gfortran.dg/goacc/goacc.exp b/gcc/testsuite/gfortran.dg/goacc/goacc.exp index f1adb186a1e4..409c5fe54003 100644 --- a/gcc/testsuite/gfortran.dg/goacc/goacc.exp +++ b/gcc/testsuite/gfortran.dg/goacc/goacc.exp @@ -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-set-target-env-var: 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" -- 2.17.1