+2012-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * doc/sourcebuild.texi (cleanup-modules, keep-modules): Update
+ documentation.
+
2012-03-15 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
* config.gcc (target_type_format_char): New. Document it. Set it for
- arm*-*-* .
+ arm*-*-* .
* configure.ac (gnu_unique_option): Use target_type_format_char in test.
- Comment rationale.
+ Comment rationale.
* configure: Regenerate .
2012-03-15 Jakub Jelinek <jakub@redhat.com>
@item cleanup-ipa-dump @var{suffix}
Removes IPA dump files generated for this test.
-@item cleanup-modules
-Removes Fortran module files generated for this test.
+@item cleanup-modules "@var{list-of-extra-modules}"
+Removes Fortran module files generated for this test, excluding the
+module names listed in keep-modules.
+Cleaning up module files is usually done automatically by the testsuite
+by looking at the source files and removing the modules after the test
+has been executed.
+@smallexample
+module MoD1
+end module MoD1
+module Mod2
+end module Mod2
+module moD3
+end module moD3
+module mod4
+end module mod4
+! @{ dg-final @{ cleanup-modules "mod1 mod2" @} @} ! redundant
+! @{ dg-final @{ keep-modules "mod3 mod4" @} @}
+@end smallexample
+
+@item keep-modules "@var{list-of-modules-not-to-delete}"
+Whitespace separated list of module names that should not be deleted by
+cleanup-modules.
+If the list of modules is empty, all modules defined in this file are kept.
+@smallexample
+module maybe_unneeded
+end module maybe_unneeded
+module keep1
+end module keep1
+module keep2
+end module keep2
+! @{ dg-final @{ keep-modules "keep1 keep2" @} @} ! just keep these two
+! @{ dg-final @{ keep-modules "" @} @} ! keep all
+@end smallexample
@item cleanup-profile-file
Removes profiling files generated for this test.
+2012-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * gfortran.fortran-torture/compile/compile.exp: Simplify.
+ * gfortran.fortran-torture/execute/execute.exp: Likewise.
+ * lib/gcc-dg.exp (cleanup-modules): Move to ..
+ * lib/fortran-modules.exp: .. this new file. Adjust users.
+ * lib/gfortran-dg.exp (gfortran-dg-runtest,
+ gfortran-dg-debug-runtest): Call cleanup-modules.
+ * lib/fortran-torture.exp (fortran-torture-execute,
+ fortran-torture): Likewise.
+ * gfortran.dg/coarray/caf.exp: Likewise.
+ * lib/lto.exp: Likewise.
+ * gfortran.dg/class_4a.f03: Adjust cleanup-modules and keep-modules.
+ * gfortran.dg/class_4b.f03: Likewise.
+ * gfortran.dg/class_4c.f03: Likewise.
+ * gfortran.dg/class_45a.f03: Likewise.
+ * gfortran.dg/binding_label_tests_10.f03: Likewise.
+ * gfortran.dg/binding_label_tests_10_main.f03: Likewise.
+ * gfortran.dg/binding_label_tests_11.f03: Likewise.
+ * gfortran.dg/binding_label_tests_11_main.f03: Likewise.
+ * gfortran.dg/binding_label_tests_13.f03: Likewise.
+ * gfortran.dg/binding_label_tests_13_main.f03: Likewise.
+ * gfortran.dg/test_common_binding_labels_2.f03: Likewise.
+ * gfortran.dg/test_common_binding_labels_2_main.f03: Likewise.
+ * gfortran.dg/test_common_binding_labels_3.f03: Likewise.
+ * gfortran.dg/test_common_binding_labels_3_main.f03: Likewise.
+ * gfortran.dg/whole_file_28.f90: Likewise.
+ * gfortran.dg/whole_file_29.f90: Likewise.
+ * gfortran.dg/whole_file_30.f90: Likewise.
+ * gfortran.dg/whole_file_31.f90: Likewise.
+
2012-03-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52267
implicit none
integer(c_int), bind(c,name="c_one") :: one
end module binding_label_tests_10
-
-! Do not use dg-final to cleanup-modules
+! { dg-final { keep-modules "" } }
use binding_label_tests_10 ! { dg-error "collides" }
use binding_label_tests_10_main
end program main
-
-! { dg-final { cleanup-modules "binding_label_tests_10_main binding_label_tests_10" } }
+! { dg-final { cleanup-modules "binding_label_tests_10" } }
one = 1
end function one
end module binding_label_tests_11
-
-! Do not use dg-final to cleanup-modules
+! { dg-final { keep-modules "" } }
use binding_label_tests_11 ! { dg-error "collides" }
use binding_label_tests_11_main
end program main
-
-! { dg-final { cleanup-modules "binding_label_tests_11_main binding_label_tests_11" } }
+! { dg-final { cleanup-modules "binding_label_tests_11" } }
integer(c_int) :: c3
bind(c) c3
end module binding_label_tests_13
+! { dg-final { keep-modules "" } }
use binding_label_tests_13 ! { dg-error "collides" }
end subroutine c_sub
end module binding_label_tests_13_main
-! { dg-final { cleanup-modules "binding_label_tests_13 binding_label_tests_13_main" } }
-
+! { dg-final { cleanup-modules "binding_label_tests_13" } }
end function basicGet
end module G_Nodes
+! { dg-final { keep-modules "" } }
type t
end type t
end module m
+! { dg-final { keep-modules "m" } }
type, extends(t) :: t2
end type t2
end module m2
+! { dg-final { keep-modules "m2" } }
end select
print *, i
end
-
-! { dg-final { cleanup-modules "m m2 m3" } }
+! { dg-final { cleanup-modules "m m2" } }
set option_list [list { -O2 } ]
set nshort [file tail [file dirname $test]]/[file tail $test]
+ list-module-names $test
foreach flags $option_list {
verbose "Testing $nshort (single), $flags" 1
dg-test $test "-fcoarray=single $flags" ""
+ cleanup-modules ""
}
foreach flags $option_list {
verbose "Testing $nshort (libcaf_single), $flags" 1
dg-test $test "-fcoarray=lib $flags -lcaf_single" ""
+ cleanup-modules ""
}
}
torture-finish
integer(c_int) :: i
bind(c, name="") /com2/
end module test_common_binding_labels_2
-
+! { dg-final { keep-modules "" } }
use test_common_binding_labels_2 ! { dg-error "does not match" }
use test_common_binding_labels_2_main
end program main
-
-! { dg-final { cleanup-modules "test_common_binding_labels_2_main test_common_binding_labels_2" } }
+! { dg-final { cleanup-modules "test_common_binding_labels_2" } }
real(c_double) :: s
bind(c, name="my_common_block") :: /mycom/
end module test_common_binding_labels_3
+! { dg-final { keep-modules "" } }
use test_common_binding_labels_3_main
use test_common_binding_labels_3 ! { dg-error "collides" }
end program main
-
-! { dg-final { cleanup-modules "test_common_binding_labels_3_main test_common_binding_labels_3" } }
+! { dg-final { cleanup-modules "test_common_binding_labels_3" } }
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 "" } }
end subroutine syntax_init_from_ifile
end module syntax_rules
end
-! { dg-final { cleanup-modules "syntax_rules ifiles iso_red" } }
+! { dg-final { cleanup-modules "iso_red" } }
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 "" } }
type(sysvector_t), target :: sol
solution => sol
end program t
-! { dg-final { cleanup-modules "system_defs_m convecreac_m" } }
+! { dg-final { cleanup-modules "system_defs_m" } }
torture-init
set-torture-options [get-fortran-torture-options]
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f]] {
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $testcase] then {
continue
fortran-torture $testcase
}
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f90]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F90]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f95]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F95]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f03]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F03]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f08]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F08]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture $testcase
-}
-
torture-finish
torture-init
set-torture-options [get-fortran-torture-options]
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f]] {
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $testcase] then {
continue
fortran-torture-execute $testcase
}
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f90]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F90]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f95]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F95]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f03]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F03]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f08]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
-foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F08]] {
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
- fortran-torture-execute $testcase
-}
-
torture-finish
# based on f-torture.exp, which was written by Rob Savoye.
load_lib target-supports.exp
+load_lib fortran-modules.exp
# Return the list of options to use for fortran torture tests.
# The default option list can be overridden by
if [string match "/*" $testcase] {
set testcase "[file tail [file dirname $src]]/[file tail $src]"
}
+ list-module-names $src
# Walk the list of options and copmile and run the testcase for all
# options that are not explicitly disabled by the .x script (if present).
}
$status "$testcase execution, $option"
}
+ cleanup-modules ""
}
return
}
}
-
+ list-module-names $src
+
# loop through all the options
set option_list $torture_with_loops
foreach option $option_list {
}
fortran-torture-compile $src "$option $options"
+ cleanup-modules ""
}
}
load_lib libgloss.exp
load_lib target-libpath.exp
load_lib torture-options.exp
+load_lib fortran-modules.exp
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
}
}
-# Remove files for specified Fortran modules.
-proc cleanup-modules { modlist } {
- foreach modname $modlist {
- remove-build-file [string tolower $modname].mod
- }
-}
-
# Scan Fortran modules for a given regexp.
#
# Argument 0 is the module name
}
set nshort [file tail [file dirname $test]]/[file tail $test]
+ list-module-names $test
foreach flags $option_list {
verbose "Testing $nshort, $flags" 1
dg-test $test $flags ${default-extra-flags}
+ cleanup-modules ""
}
}
}
set nshort [file tail [file dirname $test]]/[file tail $test]
+ list-module-names $test
foreach flags $DEBUG_TORTURE_OPTIONS {
set doit 1
if { $doit } {
verbose -log "Testing $nshort, $flags" 1
dg-test $test $flags ""
+ cleanup-modules ""
}
}
}
verbose "$testcase not supported on this target, skipping it" 3
return
}
-
+ # Should be safe for non-fortran too but be paranoid..
+ if {$sid eq "f_lto"} {
+ list-module-names $src_list
+ }
regsub "_0.*" $testcase "" testcase
# Set up the base name of executable files so they'll be unique.
|| ![string compare "link" $compile_type] } {
file_on_host delete $execname
}
+ # Should be safe for non-fortran too but be paranoid..
+ if {$sid eq "f_lto"} {
+ cleanup-modules ""
+ }
}
}