re PR fortran/56408 (Fix dependency handling of testsuite/gfortran.dg)

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
This commit is contained in:
Jakub Jelinek 2014-09-15 21:46:12 +02:00 committed by Jakub Jelinek
parent 6a3d8ef0b8
commit f6815e4095
25 changed files with 82 additions and 57 deletions

View 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

View 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 "" } }

View 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

View 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 "" } }

View 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

View 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 "" } }

View 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" }

View 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 "" } }

View 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" }

View File

@ -26,4 +26,3 @@ contains
end function basicGet
end module G_Nodes
! { dg-final { keep-modules "" } }

View 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" } }

View 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" } }

View 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" } }

View 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" } }

View 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 "" } }

View 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
!

View 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

View 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 "" } }

View 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

View 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 "" } }

View 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." }

View 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 "" } }

View 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>
!

View 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 "" } }

View 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>