re PR fortran/56408 (Fix dependency handling of testsuite/gfortran.dg)
authorJakub Jelinek <jakub@redhat.com>
Mon, 15 Sep 2014 19:46:12 +0000 (21:46 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 15 Sep 2014 19:46:12 +0000 (21:46 +0200)
PR fortran/56408
* gfortran.dg/dg.exp (gfortran_test_path, gfortran_aux_module_flags):
New global vars.
(dg-compile-aux-modules): New procedure.
* gfortran.dg/binding_label_tests_10.f03: Remove comment
and keep-modules.
* gfortran.dg/binding_label_tests_10_main.f03: Remove comment,
use dg-compile-aux-modules.
* gfortran.dg/binding_label_tests_11.f03: Remove comment
and keep-modules.
* gfortran.dg/binding_label_tests_11_main.f03: Remove comment,
use dg-compile-aux-modules.
* gfortran.dg/binding_label_tests_13.f03: Remove comment
and keep-modules.
* gfortran.dg/binding_label_tests_13_main.f03: Remove comment,
use dg-compile-aux-modules.
* gfortran.dg/binding_label_tests_26a.f90: Remove comment
and keep-modules.
* gfortran.dg/binding_label_tests_26b.f90: Remove comment,
use dg-compile-aux-modules.
* gfortran.dg/class_45a.f03: Remove keep-modules.
* gfortran.dg/class_45b.f03: Use dg-compile-aux-modules
and cleanup-modules.
* gfortran.dg/class_4a.f03: Use dg-do link, use
dg-additional-sources and cleanup-modules, remove keep-modules
and update comment.
* gfortran.dg/class_4b.f03: Don't compile anywhere, remove
keep-modules, adjust comment.
* gfortran.dg/class_4c.f03: Don't compile anywhere, remove
dg-additional-sources and cleanup-modules.
* gfortran.dg/coarray_29_1.f90: Remove keep-modules and
associated comment.
* gfortran.dg/coarray_29_2.f90: Use dg-compile-aux-modules,
remove comment.
* gfortran.dg/test_common_binding_labels_2.f03: Remove keep-modules.
* gfortran.dg/test_common_binding_labels_2_main.f03: Remove comment,
use dg-compile-aux-modules.
* gfortran.dg/test_common_binding_labels_3.f03: Remove keep-modules.
* gfortran.dg/test_common_binding_labels_3_main.f03: Remove comment,
use dg-compile-aux-modules.
* gfortran.dg/whole_file_28.f90: Remove comment and keep-modules.
* gfortran.dg/whole_file_29.f90: Remove comment, use
dg-compile-aux-modules.
* gfortran.dg/whole_file_30.f90: Remove comment and keep-modules.
* gfortran.dg/whole_file_31.f90: Remove comment, use
dg-compile-aux-modules.

From-SVN: r215275

25 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/binding_label_tests_10.f03
gcc/testsuite/gfortran.dg/binding_label_tests_10_main.f03
gcc/testsuite/gfortran.dg/binding_label_tests_11.f03
gcc/testsuite/gfortran.dg/binding_label_tests_11_main.f03
gcc/testsuite/gfortran.dg/binding_label_tests_13.f03
gcc/testsuite/gfortran.dg/binding_label_tests_13_main.f03
gcc/testsuite/gfortran.dg/binding_label_tests_26a.f90
gcc/testsuite/gfortran.dg/binding_label_tests_26b.f90
gcc/testsuite/gfortran.dg/class_45a.f03
gcc/testsuite/gfortran.dg/class_45b.f03
gcc/testsuite/gfortran.dg/class_4a.f03
gcc/testsuite/gfortran.dg/class_4b.f03
gcc/testsuite/gfortran.dg/class_4c.f03
gcc/testsuite/gfortran.dg/coarray_29_1.f90
gcc/testsuite/gfortran.dg/coarray_29_2.f90
gcc/testsuite/gfortran.dg/dg.exp
gcc/testsuite/gfortran.dg/test_common_binding_labels_2.f03
gcc/testsuite/gfortran.dg/test_common_binding_labels_2_main.f03
gcc/testsuite/gfortran.dg/test_common_binding_labels_3.f03
gcc/testsuite/gfortran.dg/test_common_binding_labels_3_main.f03
gcc/testsuite/gfortran.dg/whole_file_28.f90
gcc/testsuite/gfortran.dg/whole_file_29.f90
gcc/testsuite/gfortran.dg/whole_file_30.f90
gcc/testsuite/gfortran.dg/whole_file_31.f90

index d426cd1..45e2384 100644 (file)
@@ -1,5 +1,52 @@
 2014-09-15  Jakub Jelinek  <jakub@redhat.com>
 
+       PR fortran/56408
+       * gfortran.dg/dg.exp (gfortran_test_path, gfortran_aux_module_flags):
+       New global vars.
+       (dg-compile-aux-modules): New procedure.
+       * gfortran.dg/binding_label_tests_10.f03: Remove comment
+       and keep-modules.
+       * gfortran.dg/binding_label_tests_10_main.f03: Remove comment,
+       use dg-compile-aux-modules.
+       * gfortran.dg/binding_label_tests_11.f03: Remove comment
+       and keep-modules.
+       * gfortran.dg/binding_label_tests_11_main.f03: Remove comment,
+       use dg-compile-aux-modules.
+       * gfortran.dg/binding_label_tests_13.f03: Remove comment
+       and keep-modules.
+       * gfortran.dg/binding_label_tests_13_main.f03: Remove comment,
+       use dg-compile-aux-modules.
+       * gfortran.dg/binding_label_tests_26a.f90: Remove comment
+       and keep-modules.
+       * gfortran.dg/binding_label_tests_26b.f90: Remove comment,
+       use dg-compile-aux-modules.
+       * gfortran.dg/class_45a.f03: Remove keep-modules.
+       * gfortran.dg/class_45b.f03: Use dg-compile-aux-modules
+       and cleanup-modules.
+       * gfortran.dg/class_4a.f03: Use dg-do link, use
+       dg-additional-sources and cleanup-modules, remove keep-modules
+       and update comment.
+       * gfortran.dg/class_4b.f03: Don't compile anywhere, remove
+       keep-modules, adjust comment.
+       * gfortran.dg/class_4c.f03: Don't compile anywhere, remove
+       dg-additional-sources and cleanup-modules.
+       * gfortran.dg/coarray_29_1.f90: Remove keep-modules and
+       associated comment.
+       * gfortran.dg/coarray_29_2.f90: Use dg-compile-aux-modules,
+       remove comment.
+       * gfortran.dg/test_common_binding_labels_2.f03: Remove keep-modules.
+       * gfortran.dg/test_common_binding_labels_2_main.f03: Remove comment,
+       use dg-compile-aux-modules.
+       * gfortran.dg/test_common_binding_labels_3.f03: Remove keep-modules.
+       * gfortran.dg/test_common_binding_labels_3_main.f03: Remove comment,
+       use dg-compile-aux-modules.
+       * gfortran.dg/whole_file_28.f90: Remove comment and keep-modules.
+       * gfortran.dg/whole_file_29.f90: Remove comment, use
+       dg-compile-aux-modules.
+       * gfortran.dg/whole_file_30.f90: Remove comment and keep-modules.
+       * gfortran.dg/whole_file_31.f90: Remove comment, use
+       dg-compile-aux-modules.
+
        * lib/gcc-defs.exp (gcc_parallel_test_run_p,
        gcc_parallel_test_enable): New procedures.  If
        GCC_RUNTEST_PARALLELIZE_DIR is set in environment, override
index e609d34..0809c87 100644 (file)
@@ -1,9 +1,6 @@
 ! { dg-do compile }
-! This file must be compiled BEFORE binding_label_tests_10_main.f03, which it 
-! should be because dejagnu will sort the files.
 module binding_label_tests_10
   use iso_c_binding
   implicit none
   integer(c_int), bind(c,name="c_one") :: one
 end module binding_label_tests_10
-! { dg-final { keep-modules "" } }
index 5216fbe..bce5ef6 100644 (file)
@@ -1,6 +1,5 @@
 ! { dg-do compile }
-! This file must be compiled AFTER binding_label_tests_10.f03, which it 
-! should be because dejagnu will sort the files.
+! { dg-compile-aux-modules "binding_label_tests_10.f03" }
 module binding_label_tests_10_main
   use iso_c_binding
   implicit none
index 8dcf998..c1fc98e 100644 (file)
@@ -1,6 +1,4 @@
 ! { dg-do compile }
-! This file must be compiled BEFORE binding_label_tests_11_main.f03, which it 
-! should be because dejagnu will sort the files.
 module binding_label_tests_11
   use iso_c_binding, only: c_int
   implicit none
@@ -10,4 +8,3 @@ contains
     one = 1
   end function one
 end module binding_label_tests_11
-! { dg-final { keep-modules "" } }
index 851c32c..7ee0c8d 100644 (file)
@@ -1,6 +1,5 @@
 ! { dg-do compile }
-! This file must be compiled AFTER binding_label_tests_11.f03, which it 
-! should be because dejagnu will sort the files.
+! { dg-compile-aux-modules "binding_label_tests_11.f03" }
 module binding_label_tests_11_main
   use iso_c_binding, only: c_int
   implicit none
index a8e3179..71aac2d 100644 (file)
@@ -1,9 +1,6 @@
 ! { dg-do compile }
-! This file must be compiled BEFORE binding_label_tests_13_main.f03, which it 
-! should be because dejagnu will sort the files.  
 module binding_label_tests_13
  use, intrinsic :: iso_c_binding, only: c_int
   integer(c_int) :: c3
   bind(c) c3
 end module binding_label_tests_13
-! { dg-final { keep-modules "" } }
index da93a8b..66ff7cf 100644 (file)
@@ -1,7 +1,5 @@
 ! { dg-do compile }
-! This file must be compiled AFTER binding_label_tests_13.f03, which it 
-! should be because dejagnu will sort the files.  The module file 
-! binding_label_tests_13.mod can not be removed until after this test is done.
+! { dg-compile-aux-modules "binding_label_tests_13.f03" }
 module binding_label_tests_13_main
   use, intrinsic :: iso_c_binding, only: c_int
   integer(c_int) :: c3  ! { dg-error "Variable c3 from module binding_label_tests_13_main with binding label c3 at .1. uses the same global identifier as entity at .2. from module binding_label_tests_13" }
index 32cf07a..d3f3039 100644 (file)
@@ -4,8 +4,6 @@
 !
 ! Contributed by Andrew Bensons <abensonca@gmail.com>
 !
-! This file must be compiled BEFORE binding_label_tests_26b.f90, which it 
-! should be because dejagnu will sort the files.  
 
 module fg
 contains
@@ -16,5 +14,3 @@ contains
     end interface
   end function
 end module
-
-! { dg-final { keep-modules "" } }
index ad8426b..ca39975 100644 (file)
@@ -1,11 +1,9 @@
 ! { dg-do compile }
+! { dg-compile-aux-modules "binding_label_tests_26a.f90" }
 !
 ! PR 58182: [4.9 Regression] ICE with global binding name used as a FUNCTION
 !
 ! Contributed by Andrew Bensons <abensonca@gmail.com>
-!
-! This file must be compiled AFTER binding_label_tests_26a.f90, which it 
-! should be because dejagnu will sort the files.  
 
 module f    ! { dg-error "uses the same global identifier" }
   use fg    ! { dg-error "uses the same global identifier" }
index c3c9ac2..91f11c4 100644 (file)
@@ -26,4 +26,3 @@ contains
   end function basicGet
 
 end module G_Nodes
-! { dg-final { keep-modules "" } }
index 5c047e2..90ef467 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do link }
-! { dg-additional-sources class_45a.f03 }
+! { dg-compile-aux-modules "class_45a.f03" }
 !
 ! PR 50227: [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable
 !
@@ -10,3 +10,4 @@ program Test
   class(t0), allocatable :: c
   allocate(t1 :: c)
 end program Test
+! { dg-final { cleanup-modules "G_Nodes" } }
index 9441cc7..015e53c 100644 (file)
@@ -1,10 +1,11 @@
-! { dg-do compile }
+! { dg-do link }
+! { dg-additional-sources "class_4b.f03 class_4c.f03" }
 !
 ! Test the fix for PR41583, in which the different source files
 ! would generate the same 'vindex' for different class declared
 ! types.
 !
-! The test comprises class_4a, class_4b class_4c and class_4d.f03
+! The test comprises class_4a, class_4b and class_4c.f03
 
 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
 !
@@ -12,4 +13,4 @@ module m
   type t
   end type t
 end module m
-! { dg-final { keep-modules "m" } }
+! { dg-final { cleanup-modules "m m2" } }
index a5d914a..dda55b5 100644 (file)
@@ -1,10 +1,11 @@
-! { dg-do compile }
+! Don't compile this anywhere.
+! { dg-do compile { target { lp64 && { ! lp64 } } } }
 !
 ! Test the fix for PR41583, in which the different source files
 ! would generate the same 'vindex' for different class declared
 ! types.
 !
-! The test comprises class_4a, class_4b class_4c and class_4d.f03
+! The test comprises class_4a, class_4b class_4c.f03
 !
 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
 !
@@ -13,4 +14,3 @@ module m2
   type, extends(t) :: t2
   end type t2
 end module m2
-! { dg-final { keep-modules "m2" } }
index 088acae..e78a309 100644 (file)
@@ -1,5 +1,5 @@
-! { dg-do link }
-! { dg-additional-sources class_4a.f03 class_4b.f03 }
+! Don't compile this anywhere.
+! { dg-do compile { target { lp64 && { ! lp64 } } } }
 !
 ! Test the fix for PR41583, in which the different source files
 ! would generate the same 'vindex' for different class declared
@@ -27,4 +27,3 @@
   end select
   print *, i
 end
-! { dg-final { cleanup-modules "m m2" } }
index 2c49b1c..7d04aa8 100644 (file)
@@ -11,6 +11,3 @@ contains
     integer scalar[*]
   end subroutine
 end module
-
-! DO NOT CLEAN UP THE MODULE FILE - coarray_29_2.f90 does it.
-! { dg-final { keep-modules "" } }
index 8c0e81f..d653f3f 100644 (file)
@@ -1,8 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fcoarray=single" }
-
-! Requires that coarray_29.f90 has been compiled before
-! and that, thus, co_sum_module is available
+! { dg-compile-aux-modules "coarray_29_1.f90" }
 
 ! PR fortran/55272
 !
index eb985cb..e8c3923 100644 (file)
@@ -28,6 +28,21 @@ if ![info exists DEFAULT_FFLAGS] then {
 # Initialize `dg'.
 dg-init
 
+global gfortran_test_path
+global gfortran_aux_module_flags
+set gfortran_test_path $srcdir/$subdir
+set gfortran_aux_module_flags $DEFAULT_FFLAGS
+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
+    }
+    dg-test $gfortran_test_path/[lindex $args 1] "" $gfortran_aux_module_flags
+    # cleanup-modules isn't intentionally invoked here.
+}
+
 # Main loop.
 gfortran-dg-runtest [lsort \
        [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] "" $DEFAULT_FFLAGS
index ad654b3..8c31902 100644 (file)
@@ -12,4 +12,3 @@ module test_common_binding_labels_2
   integer(c_int) :: i
   bind(c, name="") /com2/
 end module test_common_binding_labels_2
-! { dg-final { keep-modules "" } }
index fb7778e..cd16641 100644 (file)
@@ -1,9 +1,7 @@
 ! { dg-do compile }
 ! { dg-options "-std=f2003" }
+! { dg-compile-aux-modules "test_common_binding_labels_2.f03" }
 !
-!
-! This file depends on the module test_common_binding_labels_2.  That module
-! must be compiled first and not be removed until after this test.
 module test_common_binding_labels_2_main
   use, intrinsic :: iso_c_binding, only: c_double, c_int
   implicit none
index d851b5e..87d6c6b 100644 (file)
@@ -8,4 +8,3 @@ module test_common_binding_labels_3
   real(c_double) :: s
   bind(c, name="my_common_block") :: /mycom/
 end module test_common_binding_labels_3
-! { dg-final { keep-modules "" } }
index 3ccab0c..9ad5515 100644 (file)
@@ -1,6 +1,5 @@
 ! { dg-do compile }
-! This file depends on the module test_common_binding_labels_3.  That module
-! must be compiled first and not be removed until after this test.
+! { dg-compile-aux-modules "test_common_binding_labels_3.f03" }
 module test_common_binding_labels_3_main
   use, intrinsic :: iso_c_binding, only: c_int
   integer(c_int), bind(c, name="my_common_block") :: my_int ! { dg-error "COMMON block at .1. with binding label my_common_block uses the same global identifier as entity at .2." }
index ec9efb2..681b123 100644 (file)
@@ -1,6 +1,5 @@
 ! { dg-do compile }
 ! Test the fix for the problem described in PR45077 comments #4 and #5.
-! Note that the module file is kept for whole_file_29.f90
 !
 ! Contributed by Tobias Burnus  <burnus@gcc.gnu.org>
 !
@@ -9,5 +8,3 @@ module iso_red
      character(LEN=1), dimension(:), allocatable :: chars
   end type varying_string
 end module iso_red
-! DO NOT CLEAN UP THE MODULE FILE - whole_file_29.f90 does it.
-! { dg-final { keep-modules "" } }
index 703754c..86d84cf 100644 (file)
@@ -1,7 +1,6 @@
 ! { dg-do compile }
+! { dg-compile-aux-modules "whole_file_28.f90" }
 ! Test the fix for the problem described in PR45077 comments #4 and #5.
-! Note that the module file from whole_file_28.f90, 'iso_red', is
-! needed for this test.
 !
 ! Contributed by Tobias Burnus  <burnus@gcc.gnu.org>
 !
index d8e401e..551f2e8 100644 (file)
@@ -1,6 +1,5 @@
 ! { dg-do compile }
 ! Test the fix for the problem described in PR46818.
-! Note that the module file is kept for whole_file_31.f90
 !
 ! Contributed by Martien Hulsen  <m.a.hulsen@tue.nl>
 ! and reduced by Tobias Burnus  <burnus@gcc.gnu.org>
@@ -12,5 +11,3 @@ module system_defs_m
     real, allocatable, dimension(:) :: u
   end type sysvector_t
 end module system_defs_m
-! DO NOT CLEAN UP THE MODULE FILE - whole_file_31.f90 does it.
-! { dg-final { keep-modules "" } }
index eb77055..1ed661d 100644 (file)
@@ -1,7 +1,6 @@
 ! { dg-do compile }
+! { dg-compile-aux-modules "whole_file_30.f90" }
 ! Test the fix for the problem described in PR46818.
-! Note that the module file from whole_file_30.f90, 'system_defs_m',
-! is needed for this test.
 !
 ! Contributed by Martien Hulsen  <m.a.hulsen@tue.nl>
 ! and reduced by Tobias Burnus  <burnus@gcc.gnu.org>