Commit b09940e9 by Janis Johnson Committed by Janis Johnson

gcc-dg.exp (cleanup-modules): New proc.

	* lib/gcc-dg.exp (cleanup-modules): New proc.
	* gfortran.dg/allocatable_function_1.f90,
	gfortran.dg/allocate_char_star_scalar_1.f90,
	gfortran.dg/assumed_charlen_function_1.f90,
	gfortran.dg/assumed_dummy_1.f90,
	gfortran.dg/assumed_shape_ranks_1.f90,
	gfortran.dg/assumed_shape_ranks_2.f90,
	gfortran.dg/assumed_size_dt_dummy.f90,
	gfortran.dg/auto_char_dummy_array_1.f90,
	gfortran.dg/auto_char_len_3.f90,
	gfortran.dg/automatic_module_variable.f90,
	gfortran.dg/bad_automatic_objects_1.f90,
	gfortran.dg/char_array_constructor.f90,
	gfortran.dg/char_array_structure_constructor.f90,
	gfortran.dg/char_result_11.f90, gfortran.dg/char_result_9.f90,
	gfortran.dg/contained_1.f90, gfortran.dg/convert_1.f90,
	gfortran.dg/cray_pointers_5.f90, gfortran.dg/data_constraints_1.f90,
	gfortran.dg/default_initialization.f90, gfortran.dg/der_charlen_1.f90,
	gfortran.dg/der_io_2.f90, gfortran.dg/der_io_3.f90,
	gfortran.dg/derived_pointer_recursion.f90,
	gfortran.dg/derived_recursion.f90, gfortran.dg/der_pointer_1.f90,
	gfortran.dg/der_pointer_3.f90, gfortran.dg/der_pointer_4.f90,
	gfortran.dg/dummy_functions_1.f90,
	gfortran.dg/elemental_initializer_1.f90,
	gfortran.dg/elemental_non_intrinsic_dummy_1.f90,
	gfortran.dg/elemental_pointer_1.f90,
	gfortran.dg/elemental_subroutine_1.f90,
	gfortran.dg/elemental_subroutine_2.f90, gfortran.dg/entry_1.f90,
	gfortran.dg/entry_3.f90, gfortran.dg/enum_10.f90,
	gfortran.dg/equiv_constraint_3.f90, gfortran.dg/func_derived_1.f90,
	gfortran.dg/func_derived_2.f90, gfortran.dg/func_derived_3.f90,
	gfortran.dg/generic_1.f90, gfortran.dg/generic_2.f90,
	gfortran.dg/generic_3.f90, gfortran.dg/generic_4.f90,
	gfortran.dg/global_references_1.f90,
	gfortran.dg/host_used_types_1.f90, gfortran.dg/implicit_1.f90,
	gfortran.dg/implicit_2.f90, gfortran.dg/implicit_actual.f90,
	gfortran.dg/initialization_1.f90, gfortran.dg/int_1.f90,
	gfortran.dg/intent_used_1.f90, gfortran.dg/interface_1.f90,
	gfortran.dg/interface_2.f90, gfortran.dg/internal_references_2.f90,
	gfortran.dg/io_constraints_1.f90, gfortran.dg/io_constraints_2.f90,
	gfortran.dg/large_integer_kind_1.f90,
	gfortran.dg/large_real_kind_1.f90,
	gfortran.dg/module_blank_common.f90, gfortran.dg/module_commons_1.f90,
	gfortran.dg/module_double_reuse.f90,
	gfortran.dg/module_equivalence_1.f90,
	gfortran.dg/module_interface_1.f90,
	gfortran.dg/module_parameter_array_refs_1.f90,
	gfortran.dg/named_interface.f90, gfortran.dg/namelist_14.f90,
	gfortran.dg/namelist_15.f90, gfortran.dg/namelist_1.f90,
	gfortran.dg/namelist_4.f90, gfortran.dg/namelist_use.f90,
	gfortran.dg/namelist_use_only.f90, gfortran.dg/nested_modules_1.f90,
	gfortran.dg/nested_modules_2.f90, gfortran.dg/nested_modules_3.f90,
	gfortran.dg/nested_modules_4.f90, gfortran.dg/nested_modules_5.f90,
	gfortran.dg/parens_5.f90, gfortran.dg/parent_result_ref_4.f90,
	gfortran.dg/pr15164.f90, gfortran.dg/pr16861.f90,
	gfortran.dg/pr17615.f90, gfortran.dg/pr19926.f90,
	gfortran.dg/pr21177.f90, gfortran.dg/pr26246_1.f90,
	gfortran.dg/private_type_1.f90, gfortran.dg/private_type_2.f90,
	gfortran.dg/private_type_3.f90, gfortran.dg/private_type_4.f90,
	gfortran.dg/procedure_lvalue.f90, gfortran.dg/pure_byref_3.f90,
	gfortran.dg/same_name_1.f90,
	gfortran.dg/sibling_dummy_procedure_1.f90,
	gfortran.dg/sibling_dummy_procedure_2.f90,
	gfortran.dg/sibling_dummy_procedure_3.f90,
	gfortran.dg/substr_1.f90, gfortran.dg/substring_equivalence.f90,
	gfortran.dg/use_allocated_1.f90, gfortran.dg/used_dummy_types_1.f90,
	gfortran.dg/used_dummy_types_2.f90,
	gfortran.dg/used_dummy_types_3.f90,
	gfortran.dg/used_dummy_types_4.f90,
	gfortran.dg/used_dummy_types_5.f90,
	gfortran.dg/used_interface_ref.f90, gfortran.dg/used_types_1.f90,
	gfortran.dg/userdef_operator_1.f90: Use it.

From-SVN: r112264
parent d9870b7e
2006-03-21 Janis Johnson <janis187@us.ibm.com>
* lib/gcc-dg.exp (cleanup-modules): New proc.
* gfortran.dg/allocatable_function_1.f90,
gfortran.dg/allocate_char_star_scalar_1.f90,
gfortran.dg/assumed_charlen_function_1.f90,
gfortran.dg/assumed_dummy_1.f90,
gfortran.dg/assumed_shape_ranks_1.f90,
gfortran.dg/assumed_shape_ranks_2.f90,
gfortran.dg/assumed_size_dt_dummy.f90,
gfortran.dg/auto_char_dummy_array_1.f90,
gfortran.dg/auto_char_len_3.f90,
gfortran.dg/automatic_module_variable.f90,
gfortran.dg/bad_automatic_objects_1.f90,
gfortran.dg/char_array_constructor.f90,
gfortran.dg/char_array_structure_constructor.f90,
gfortran.dg/char_result_11.f90, gfortran.dg/char_result_9.f90,
gfortran.dg/contained_1.f90, gfortran.dg/convert_1.f90,
gfortran.dg/cray_pointers_5.f90, gfortran.dg/data_constraints_1.f90,
gfortran.dg/default_initialization.f90, gfortran.dg/der_charlen_1.f90,
gfortran.dg/der_io_2.f90, gfortran.dg/der_io_3.f90,
gfortran.dg/derived_pointer_recursion.f90,
gfortran.dg/derived_recursion.f90, gfortran.dg/der_pointer_1.f90,
gfortran.dg/der_pointer_3.f90, gfortran.dg/der_pointer_4.f90,
gfortran.dg/dummy_functions_1.f90,
gfortran.dg/elemental_initializer_1.f90,
gfortran.dg/elemental_non_intrinsic_dummy_1.f90,
gfortran.dg/elemental_pointer_1.f90,
gfortran.dg/elemental_subroutine_1.f90,
gfortran.dg/elemental_subroutine_2.f90, gfortran.dg/entry_1.f90,
gfortran.dg/entry_3.f90, gfortran.dg/enum_10.f90,
gfortran.dg/equiv_constraint_3.f90, gfortran.dg/func_derived_1.f90,
gfortran.dg/func_derived_2.f90, gfortran.dg/func_derived_3.f90,
gfortran.dg/generic_1.f90, gfortran.dg/generic_2.f90,
gfortran.dg/generic_3.f90, gfortran.dg/generic_4.f90,
gfortran.dg/global_references_1.f90,
gfortran.dg/host_used_types_1.f90, gfortran.dg/implicit_1.f90,
gfortran.dg/implicit_2.f90, gfortran.dg/implicit_actual.f90,
gfortran.dg/initialization_1.f90, gfortran.dg/int_1.f90,
gfortran.dg/intent_used_1.f90, gfortran.dg/interface_1.f90,
gfortran.dg/interface_2.f90, gfortran.dg/internal_references_2.f90,
gfortran.dg/io_constraints_1.f90, gfortran.dg/io_constraints_2.f90,
gfortran.dg/large_integer_kind_1.f90,
gfortran.dg/large_real_kind_1.f90,
gfortran.dg/module_blank_common.f90, gfortran.dg/module_commons_1.f90,
gfortran.dg/module_double_reuse.f90,
gfortran.dg/module_equivalence_1.f90,
gfortran.dg/module_interface_1.f90,
gfortran.dg/module_parameter_array_refs_1.f90,
gfortran.dg/named_interface.f90, gfortran.dg/namelist_14.f90,
gfortran.dg/namelist_15.f90, gfortran.dg/namelist_1.f90,
gfortran.dg/namelist_4.f90, gfortran.dg/namelist_use.f90,
gfortran.dg/namelist_use_only.f90, gfortran.dg/nested_modules_1.f90,
gfortran.dg/nested_modules_2.f90, gfortran.dg/nested_modules_3.f90,
gfortran.dg/nested_modules_4.f90, gfortran.dg/nested_modules_5.f90,
gfortran.dg/parens_5.f90, gfortran.dg/parent_result_ref_4.f90,
gfortran.dg/pr15164.f90, gfortran.dg/pr16861.f90,
gfortran.dg/pr17615.f90, gfortran.dg/pr19926.f90,
gfortran.dg/pr21177.f90, gfortran.dg/pr26246_1.f90,
gfortran.dg/private_type_1.f90, gfortran.dg/private_type_2.f90,
gfortran.dg/private_type_3.f90, gfortran.dg/private_type_4.f90,
gfortran.dg/procedure_lvalue.f90, gfortran.dg/pure_byref_3.f90,
gfortran.dg/same_name_1.f90,
gfortran.dg/sibling_dummy_procedure_1.f90,
gfortran.dg/sibling_dummy_procedure_2.f90,
gfortran.dg/sibling_dummy_procedure_3.f90,
gfortran.dg/substr_1.f90, gfortran.dg/substring_equivalence.f90,
gfortran.dg/use_allocated_1.f90, gfortran.dg/used_dummy_types_1.f90,
gfortran.dg/used_dummy_types_2.f90,
gfortran.dg/used_dummy_types_3.f90,
gfortran.dg/used_dummy_types_4.f90,
gfortran.dg/used_dummy_types_5.f90,
gfortran.dg/used_interface_ref.f90, gfortran.dg/used_types_1.f90,
gfortran.dg/userdef_operator_1.f90: Use it.
2006-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2006-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gfortran.dg/advance.f90, gfortran.dg/backspace_2.f, * gfortran.dg/advance.f90, gfortran.dg/backspace_2.f,
...@@ -109,4 +109,4 @@ contains ...@@ -109,4 +109,4 @@ contains
end program alloc_fun end program alloc_fun
! { dg-final { scan-tree-dump-times "free" 9 "original" } } ! { dg-final { scan-tree-dump-times "free" 9 "original" } }
! { dg-final { cleanup-tree-dump "original" } } ! { dg-final { cleanup-tree-dump "original" } }
! { dg-final { cleanup-modules "m" } }
...@@ -29,3 +29,5 @@ program hum ...@@ -29,3 +29,5 @@ program hum
call foo(q) call foo(q)
end program hum end program hum
! { dg-final { cleanup-modules "moo" } }
...@@ -81,3 +81,4 @@ end function not_OK ...@@ -81,3 +81,4 @@ end function not_OK
END END
! { dg-final { cleanup-modules "M1 INTEGER_SETS" } }
...@@ -43,4 +43,4 @@ contains ...@@ -43,4 +43,4 @@ contains
END SUBROUTINE roo END SUBROUTINE roo
end program test end program test
! { dg-final { cleanup-modules "global" } }
...@@ -23,3 +23,4 @@ CONTAINS ...@@ -23,3 +23,4 @@ CONTAINS
END SUBROUTINE TST END SUBROUTINE TST
END END
! { dg-final { cleanup-modules "addon" } }
...@@ -43,3 +43,5 @@ end module mod1 ...@@ -43,3 +43,5 @@ end module mod1
call foo (bar, i) call foo (bar, i)
if (i .ne. 2) call abort () if (i .ne. 2) call abort ()
end end
! { dg-final { cleanup-modules "mod1" } }
...@@ -15,3 +15,4 @@ END MODULE TEST ...@@ -15,3 +15,4 @@ END MODULE TEST
end end
! { dg-final { cleanup-modules "TEST" } }
...@@ -54,3 +54,4 @@ contains ...@@ -54,3 +54,4 @@ contains
end program oh_no_not_pr15908_again end program oh_no_not_pr15908_again
! { dg-final { cleanup-modules "global" } }
...@@ -23,3 +23,5 @@ program TestStringTools ...@@ -23,3 +23,5 @@ program TestStringTools
if (txt .ne. "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz") & if (txt .ne. "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz") &
call abort () call abort ()
end program TestStringTools end program TestStringTools
! { dg-final { cleanup-modules "chtest" } }
...@@ -14,3 +14,5 @@ contains ...@@ -14,3 +14,5 @@ contains
init = x init = x
end function init end function init
end module sd end module sd
! { dg-final { cleanup-modules "sd" } }
...@@ -18,3 +18,5 @@ program foobar ...@@ -18,3 +18,5 @@ program foobar
integer, dimension (i) :: k ! { dg-error "must have constant shape" } integer, dimension (i) :: k ! { dg-error "must have constant shape" }
character (len = i) :: c2 ! { dg-error "must have constant character length" } character (len = i) :: c2 ! { dg-error "must have constant character length" }
end program foobar end program foobar
! { dg-final { cleanup-modules "foo bar" } }
...@@ -13,3 +13,4 @@ program y ...@@ -13,3 +13,4 @@ program y
if (b(2) /= 'efghij') call abort if (b(2) /= 'efghij') call abort
end program y end program y
! { dg-final { cleanup-modules "z" } }
...@@ -26,3 +26,5 @@ contains ...@@ -26,3 +26,5 @@ contains
ENDDO ENDDO
end subroutine alloc end subroutine alloc
END program char_array_structure_constructor END program char_array_structure_constructor
! { dg-final { cleanup-modules "global" } }
...@@ -113,3 +113,5 @@ program test ...@@ -113,3 +113,5 @@ program test
print *, str print *, str
end program test end program test
! { dg-final { cleanup-modules "cutils" } }
...@@ -22,3 +22,5 @@ program huj ...@@ -22,3 +22,5 @@ program huj
s = s_to_c(c) s = s_to_c(c)
end program huj end program huj
! { dg-final { cleanup-modules "foo" } }
...@@ -31,3 +31,5 @@ program contained_1 ...@@ -31,3 +31,5 @@ program contained_1
call a call a
if (i .ne. 1) call abort if (i .ne. 1) call abort
end program end program
! { dg-final { cleanup-modules "contained_1_mod" } }
...@@ -14,3 +14,5 @@ USE MODULE_A ...@@ -14,3 +14,5 @@ USE MODULE_A
USE MODULE_B USE MODULE_B
a = 0 a = 0
END END
! { dg-final { cleanup-modules "MODULE_A MODULE_B" } }
...@@ -13,3 +13,5 @@ end module cray_pointers_5 ...@@ -13,3 +13,5 @@ end module cray_pointers_5
ipt = loc (arr) ipt = loc (arr)
if (any (var .ne. (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/))) call abort if (any (var .ne. (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/))) call abort
end end
! { dg-final { cleanup-modules "cray_pointers_5" } }
...@@ -28,3 +28,5 @@ contains ...@@ -28,3 +28,5 @@ contains
data foobar /0/ ! { dg-error "conflicts with FUNCTION" } data foobar /0/ ! { dg-error "conflicts with FUNCTION" }
end function foobar end function foobar
end end
! { dg-final { cleanup-modules "global" } }
...@@ -16,3 +16,5 @@ module bad ...@@ -16,3 +16,5 @@ module bad
end type default_initialization end type default_initialization
type (default_initialization) t ! { dg-error "default initialization" } type (default_initialization) t ! { dg-error "default initialization" }
end module bad end module bad
! { dg-final { cleanup-modules "bad" } }
...@@ -22,3 +22,5 @@ CONTAINS ...@@ -22,3 +22,5 @@ CONTAINS
type(T), intent(in) :: X type(T), intent(in) :: X
end subroutine end subroutine
end module another_core end module another_core
! { dg-final { cleanup-modules "core another_core" } }
...@@ -52,4 +52,4 @@ program prog ...@@ -52,4 +52,4 @@ program prog
write (*, *) zb write (*, *) zb
end program prog end program prog
! { dg-final { cleanup-modules "gfortran2" } }
...@@ -38,3 +38,5 @@ end module m2 ...@@ -38,3 +38,5 @@ end module m2
use m2 use m2
call test call test
end end
! { dg-final { cleanup-modules "m1 m2" } }
...@@ -16,3 +16,5 @@ module test ...@@ -16,3 +16,5 @@ module test
type(x_t), pointer :: x type(x_t), pointer :: x
end module test end module test
! { dg-final { cleanup-modules "test" } }
...@@ -16,3 +16,5 @@ end module ints ...@@ -16,3 +16,5 @@ end module ints
program size_test program size_test
use ints use ints
end program size_test end program size_test
! { dg-final { cleanup-modules "ints" } }
...@@ -9,3 +9,5 @@ module crash ...@@ -9,3 +9,5 @@ module crash
end type foo end type foo
type (foo), save :: bar type (foo), save :: bar
end module crash end module crash
! { dg-final { cleanup-modules "crash" } }
...@@ -20,3 +20,4 @@ ...@@ -20,3 +20,4 @@
! copyright 1996 Loren P. Meissner -- May be distributed if this line is included. ! copyright 1996 Loren P. Meissner -- May be distributed if this line is included.
! Linked List operations with Pointer to Pointer ! Linked List operations with Pointer to Pointer
! { dg-final { cleanup-modules "llo" } }
...@@ -22,3 +22,5 @@ end module snafu ...@@ -22,3 +22,5 @@ end module snafu
! use snafu ! use snafu
! foo%v = 1 ! foo%v = 1
! end ! end
! { dg-final { cleanup-modules "snafu" } }
...@@ -34,3 +34,5 @@ program test ...@@ -34,3 +34,5 @@ program test
use innerfun use innerfun
call foo(3,f) call foo(3,f)
end program test end program test
! { dg-final { cleanup-modules "innerfun outerfun" } }
...@@ -31,3 +31,5 @@ contains ...@@ -31,3 +31,5 @@ contains
end function len_ end function len_
end module iso_varying_string end module iso_varying_string
! { dg-final { cleanup-modules "iso_varying_string" } }
...@@ -19,3 +19,5 @@ INTEGER FUNCTION SUB(XX) ...@@ -19,3 +19,5 @@ INTEGER FUNCTION SUB(XX)
INTEGER :: XX INTEGER :: XX
SUB=XX() SUB=XX()
END END
! { dg-final { cleanup-modules "TT" } }
...@@ -9,3 +9,5 @@ CONTAINS ...@@ -9,3 +9,5 @@ CONTAINS
POINTER :: LL ! { dg-error " POINTER attribute conflicts with ELEMENTAL attribute" } POINTER :: LL ! { dg-error " POINTER attribute conflicts with ELEMENTAL attribute" }
END FUNCTION LL END FUNCTION LL
END MODULE Test END MODULE Test
! { dg-final { cleanup-modules "Test" } }
...@@ -56,3 +56,5 @@ contains ...@@ -56,3 +56,5 @@ contains
b = -a b = -a
end subroutine foobar end subroutine foobar
end end
! { dg-final { cleanup-modules "pr22146" } }
...@@ -62,3 +62,5 @@ program test_assign ...@@ -62,3 +62,5 @@ program test_assign
if (any(reshape (i, (/4/)).ne.(/1,8,27,64/))) call abort () if (any(reshape (i, (/4/)).ne.(/1,8,27,64/))) call abort ()
end program test_assign end program test_assign
! { dg-final { cleanup-modules "type assign" } }
...@@ -43,3 +43,5 @@ program p ...@@ -43,3 +43,5 @@ program p
call test1 () call test1 ()
call test2 () call test2 ()
end program end program
! { dg-final { cleanup-modules "m" } }
...@@ -23,3 +23,5 @@ program entry_4_prog ...@@ -23,3 +23,5 @@ program entry_4_prog
call bar(a) call bar(a)
if (any (a .ne. (/3, 4/))) call abort if (any (a .ne. (/3, 4/))) call abort
end program end program
! { dg-final { cleanup-modules "entry_4" } }
...@@ -59,3 +59,5 @@ call f4 (one4, 1) ...@@ -59,3 +59,5 @@ call f4 (one4, 1)
call f4 (two4, 2) call f4 (two4, 2)
call f4 (max4, huge(1_4)+0) call f4 (max4, huge(1_4)+0)
end end
! { dg-final { cleanup-modules "enum_10" } }
...@@ -10,4 +10,4 @@ INTEGER :: L ...@@ -10,4 +10,4 @@ INTEGER :: L
EQUIVALENCE(K,L) ! { dg-error "conflicts with USE ASSOCIATED attribute" } EQUIVALENCE(K,L) ! { dg-error "conflicts with USE ASSOCIATED attribute" }
END END
! { dg-final { cleanup-modules "TEST" } }
...@@ -36,3 +36,5 @@ function f(i,x,c,arr) ...@@ -36,3 +36,5 @@ function f(i,x,c,arr)
end function f end function f
end end
! { dg-final { cleanup-modules "m" } }
...@@ -39,4 +39,4 @@ program func_derived_2 ...@@ -39,4 +39,4 @@ program func_derived_2
if (y%i.ne.112) call abort () if (y%i.ne.112) call abort ()
end program func_derived_2 end program func_derived_2
! { dg-final { cleanup-modules "mpoint" } }
...@@ -123,3 +123,5 @@ end module func_derived_3a ...@@ -123,3 +123,5 @@ end module func_derived_3a
if (trim (line).ne."simple = 1") call abort () if (trim (line).ne."simple = 1") call abort ()
close (10) close (10)
end program end program
! { dg-final { cleanup-modules "func_derived_3 func_derived_3a" } }
...@@ -17,3 +17,5 @@ end module ...@@ -17,3 +17,5 @@ end module
subroutine BAZ(X) subroutine BAZ(X)
use FOO use FOO
end subroutine end subroutine
! { dg-final { cleanup-modules "FOO" } }
...@@ -18,3 +18,5 @@ end module bidon ...@@ -18,3 +18,5 @@ end module bidon
integer,intent(in) :: nspden integer,intent(in) :: nspden
end subroutine nonlinear end subroutine nonlinear
! { dg-final { cleanup-modules "bidon" } }
...@@ -28,3 +28,5 @@ subroutine mrqcof( x, y, sig, ndata, a, ia, ma ) ...@@ -28,3 +28,5 @@ subroutine mrqcof( x, y, sig, ndata, a, ia, ma )
call gauss( x(i), a, yan, dyda, ma ) call gauss( x(i), a, yan, dyda, ma )
end do end do
end subroutine mrqcof end subroutine mrqcof
! { dg-final { cleanup-modules "fit_functions" } }
...@@ -26,3 +26,5 @@ y = (/1,2,3/) ...@@ -26,3 +26,5 @@ y = (/1,2,3/)
call baz(y,z) call baz(y,z)
if (any (y /= z)) call abort () if (any (y /= z)) call abort ()
end end
! { dg-final { cleanup-modules "FOO" } }
...@@ -96,3 +96,5 @@ END SUBROUTINE j ...@@ -96,3 +96,5 @@ END SUBROUTINE j
entry link2 (nameg) ! { dg-error "is already being used as a SUBROUTINE" } entry link2 (nameg) ! { dg-error "is already being used as a SUBROUTINE" }
return return
end end
! { dg-final { cleanup-modules "m" } }
...@@ -38,3 +38,5 @@ contains ...@@ -38,3 +38,5 @@ contains
end subroutine SetTimeSteps end subroutine SetTimeSteps
end module ThermoData end module ThermoData
! { dg-final { cleanup-modules "ModelParams ThermoData" } }
...@@ -9,3 +9,4 @@ implicit none ...@@ -9,3 +9,4 @@ implicit none
common/rommel/aaa ! { dg-error "no IMPLICIT type" "no IMPLICIT type" } common/rommel/aaa ! { dg-error "no IMPLICIT type" "no IMPLICIT type" }
end end
! { dg-final { cleanup-modules "AHFinder_dat" } }
...@@ -46,3 +46,5 @@ subroutine bar() ...@@ -46,3 +46,5 @@ subroutine bar()
v%i = 42 v%i = 42
end subroutine end subroutine
end module end module
! { dg-final { cleanup-modules "implicit_2" } }
...@@ -32,3 +32,4 @@ contains ...@@ -32,3 +32,4 @@ contains
end subroutine foo end subroutine foo
end program snafu end program snafu
! { dg-final { cleanup-modules "global" } }
...@@ -34,3 +34,5 @@ contains ...@@ -34,3 +34,5 @@ contains
end subroutine foo end subroutine foo
end module const end module const
! { dg-final { cleanup-modules "const" } }
...@@ -170,3 +170,5 @@ program test_int ...@@ -170,3 +170,5 @@ program test_int
if (i4 /= 17_ik4 .or. i8 /= 17_ik8) call abort if (i4 /= 17_ik4 .or. i8 /= 17_ik8) call abort
end program test_int end program test_int
! { dg-final { cleanup-modules "mykinds" } }
...@@ -15,3 +15,5 @@ MODULE global ...@@ -15,3 +15,5 @@ MODULE global
END SUBROUTINE foo END SUBROUTINE foo
END INTERFACE END INTERFACE
END MODULE global END MODULE global
! { dg-final { cleanup-modules "global" } }
...@@ -38,3 +38,5 @@ module z ...@@ -38,3 +38,5 @@ module z
end function end function
end module z end module z
! { dg-final { cleanup-modules "y z" } }
...@@ -27,3 +27,5 @@ CONTAINS ...@@ -27,3 +27,5 @@ CONTAINS
END FUNCTION Compare_Float_Single END FUNCTION Compare_Float_Single
END MODULE Compare_Float_Numbers END MODULE Compare_Float_Numbers
! { dg-final { cleanup-modules "Compare_Float_Numbers" } }
...@@ -18,3 +18,5 @@ contains ...@@ -18,3 +18,5 @@ contains
real a real a
end subroutine sub end subroutine sub
end module aap end module aap
! { dg-final { cleanup-modules "aap" } }
...@@ -76,3 +76,5 @@ end module global ...@@ -76,3 +76,5 @@ end module global
100 continue 100 continue
200 format (2i6) 200 format (2i6)
END END
! { dg-final { cleanup-modules "fails global" } }
...@@ -67,3 +67,5 @@ end module global ...@@ -67,3 +67,5 @@ end module global
100 continue 100 continue
200 format (2i6) 200 format (2i6)
END END
! { dg-final { cleanup-modules "global" } }
...@@ -36,3 +36,5 @@ program test ...@@ -36,3 +36,5 @@ program test
x = -huge(0_8) x = -huge(0_8)
call testoutput (x,-huge(0_8),50,'(I50)') call testoutput (x,-huge(0_8),50,'(I50)')
end program test end program test
! { dg-final { cleanup-modules "testmod" } }
...@@ -75,3 +75,5 @@ program test ...@@ -75,3 +75,5 @@ program test
c2(1:1) = ' ' c2(1:1) = ' '
if (c1 /= c2) call abort if (c1 /= c2) call abort
end program test end program test
! { dg-final { cleanup-modules "testmod" } }
...@@ -16,4 +16,4 @@ program blank_common ...@@ -16,4 +16,4 @@ program blank_common
if (z.ne.cmplx (a,b)) call abort () if (z.ne.cmplx (a,b)) call abort ()
end program blank_common end program blank_common
! { dg-final { cleanup-modules "global" } }
...@@ -22,3 +22,4 @@ program collision ...@@ -22,3 +22,4 @@ program collision
call foo () call foo ()
end program collision end program collision
! { dg-final { cleanup-modules "m1 m2" } }
...@@ -17,3 +17,4 @@ program d ...@@ -17,3 +17,4 @@ program d
if (v.ne.u) call abort () if (v.ne.u) call abort ()
end program d end program d
! { dg-final { cleanup-modules "a" } }
...@@ -23,4 +23,4 @@ program module_equiv ...@@ -23,4 +23,4 @@ program module_equiv
call foo () call foo ()
end program module_equiv end program module_equiv
! { dg-final { cleanup-modules "test_equiv" } }
...@@ -34,3 +34,5 @@ ...@@ -34,3 +34,5 @@
return return
end subroutine Selection_Sort end subroutine Selection_Sort
end program module_interface end program module_interface
! { dg-final { cleanup-modules "Max_Loc_mod" } }
...@@ -11,3 +11,4 @@ module foo ...@@ -11,3 +11,4 @@ module foo
end end
! { dg-final { cleanup-modules "foo" } }
...@@ -7,3 +7,5 @@ module snafu ...@@ -7,3 +7,5 @@ module snafu
end subroutine really_snafu end subroutine really_snafu
end interface foo end interface foo
end module snafu end module snafu
! { dg-final { cleanup-modules "snafu" } }
...@@ -5,3 +5,5 @@ module namelist_1 ...@@ -5,3 +5,5 @@ module namelist_1
integer,private :: x integer,private :: x
namelist /n/ x ! { dg-error "cannot be member of PUBLIC namelist" "" } namelist /n/ x ! { dg-error "cannot be member of PUBLIC namelist" "" }
end module end module
! { dg-final { cleanup-modules "namelist_1" } }
...@@ -92,3 +92,5 @@ contains ...@@ -92,3 +92,5 @@ contains
end subroutine foo end subroutine foo
end program namelist_14 end program namelist_14
! { dg-final { cleanup-modules "global" } }
...@@ -57,3 +57,5 @@ program namelist_15 ...@@ -57,3 +57,5 @@ program namelist_15
(x(2)%m(2)%ch(2) == "kz"))) call abort () (x(2)%m(2)%ch(2) == "kz"))) call abort ()
end program namelist_15 end program namelist_15
! { dg-final { cleanup-modules "global" } }
...@@ -37,3 +37,4 @@ CONTAINS ...@@ -37,3 +37,4 @@ CONTAINS
END FUNCTION END FUNCTION
END END
! { dg-final { cleanup-modules "M1" } }
...@@ -29,3 +29,5 @@ program namelist_use ...@@ -29,3 +29,5 @@ program namelist_use
close (10) close (10)
end program namelist_use end program namelist_use
! { dg-final { cleanup-modules "global" } }
...@@ -32,3 +32,5 @@ program namelist_use_only ...@@ -32,3 +32,5 @@ program namelist_use_only
if ((i.ne.0).or.(rrrr.ne.3.5).or.foo()) call abort () if ((i.ne.0).or.(rrrr.ne.3.5).or.foo()) call abort ()
close (10) close (10)
end program namelist_use_only end program namelist_use_only
! { dg-final { cleanup-modules "global" } }
...@@ -41,3 +41,5 @@ ...@@ -41,3 +41,5 @@
call eyeore () call eyeore ()
call tigger (w) call tigger (w)
end end
! { dg-final { cleanup-modules "mod0 mod1 mod2" } }
...@@ -36,3 +36,4 @@ program testfoobar ...@@ -36,3 +36,4 @@ program testfoobar
if (all (l.ne.(/84,42,0/))) call abort () if (all (l.ne.(/84,42,0/))) call abort ()
end program testfoobar end program testfoobar
! { dg-final { cleanup-modules "foo bar foobar" } }
...@@ -53,3 +53,5 @@ PROGRAM use_foobar ...@@ -53,3 +53,5 @@ PROGRAM use_foobar
CALL sub3 (z, j) CALL sub3 (z, j)
IF (ALL (j.ne.(/3,2,1/))) CALL abort () IF (ALL (j.ne.(/3,2,1/))) CALL abort ()
END PROGRAM use_foobar END PROGRAM use_foobar
! { dg-final { cleanup-modules "foo bar foobar" } }
...@@ -23,3 +23,5 @@ end module serial ...@@ -23,3 +23,5 @@ end module serial
character*15 :: buffer character*15 :: buffer
buffer = lc ("Have a Nice DAY") buffer = lc ("Have a Nice DAY")
end end
! { dg-final { cleanup-modules "string serial" } }
...@@ -24,3 +24,5 @@ end module serial ...@@ -24,3 +24,5 @@ end module serial
character*15 :: buffer character*15 :: buffer
buffer = lc ("Have a Nice DAY") buffer = lc ("Have a Nice DAY")
end end
! { dg-final { cleanup-modules "anything serial" } }
...@@ -17,3 +17,5 @@ program test ...@@ -17,3 +17,5 @@ program test
c = bobo(5) c = bobo(5)
if (c .ne. "12345") call abort if (c .ne. "12345") call abort
end program test end program test
! { dg-final { cleanup-modules "para" } }
...@@ -20,3 +20,5 @@ end module m ...@@ -20,3 +20,5 @@ end module m
use m use m
if (f ().ne.2) call abort () if (f ().ne.2) call abort ()
end end
! { dg-final { cleanup-modules "m" } }
...@@ -14,3 +14,4 @@ ...@@ -14,3 +14,4 @@
end subroutine split end subroutine split
end module specfiles end module specfiles
! { dg-final { cleanup-modules "specfiles" } }
...@@ -30,3 +30,5 @@ end subroutine quus ...@@ -30,3 +30,5 @@ end subroutine quus
program test program test
call quus call quus
end program test end program test
! { dg-final { cleanup-modules "foo bar" } }
...@@ -17,3 +17,5 @@ PROGRAM TEST ...@@ -17,3 +17,5 @@ PROGRAM TEST
real(8) :: c(3) real(8) :: c(3)
c = cross_product() c = cross_product()
END PROGRAM TEST END PROGRAM TEST
! { dg-final { cleanup-modules "module_vec3d" } }
...@@ -23,3 +23,4 @@ subroutine string_comp(i) ...@@ -23,3 +23,4 @@ subroutine string_comp(i)
i = map(42) i = map(42)
end subroutine string_comp end subroutine string_comp
! { dg-final { cleanup-modules "b" } }
...@@ -51,3 +51,5 @@ program test ...@@ -51,3 +51,5 @@ program test
if (tt(null(c4)) /= 3) call abort() if (tt(null(c4)) /= 3) call abort()
if (tt(null(c8)) /= 4) call abort() if (tt(null(c8)) /= 4) call abort()
end program test end program test
! { dg-final { cleanup-modules "mymod" } }
...@@ -16,3 +16,4 @@ end module pr26246_1 ...@@ -16,3 +16,4 @@ end module pr26246_1
! { dg-final { scan-tree-dump-times "static int" 0 "original" } } ! { dg-final { scan-tree-dump-times "static int" 0 "original" } }
! { dg-final { cleanup-tree-dump "original" } } ! { dg-final { cleanup-tree-dump "original" } }
! { dg-final { cleanup-modules "pr26246_1" } }
...@@ -17,3 +17,4 @@ contains ...@@ -17,3 +17,4 @@ contains
end subroutine dummysub end subroutine dummysub
end module modboom end module modboom
! { dg-final { cleanup-modules "modboom" } }
...@@ -21,4 +21,4 @@ MODULE TEST ...@@ -21,4 +21,4 @@ MODULE TEST
END MODULE END MODULE
END END
! { dg-final { cleanup-modules "TEST" } }
...@@ -31,3 +31,4 @@ module c ...@@ -31,3 +31,4 @@ module c
end subroutine d end subroutine d
end module c end module c
! { dg-final { cleanup-modules "a c" } }
...@@ -15,3 +15,5 @@ contains ...@@ -15,3 +15,5 @@ contains
end function end function
end module end module
! { dg-final { cleanup-modules "m1" } }
...@@ -17,3 +17,5 @@ subroutine r ...@@ -17,3 +17,5 @@ subroutine r
b = 1. ! { dg-error "l-value since it is a procedure" } b = 1. ! { dg-error "l-value since it is a procedure" }
y = a(1.) y = a(1.)
end subroutine r end subroutine r
! { dg-final { cleanup-modules "t" } }
...@@ -31,3 +31,5 @@ program pure_byref_3 ...@@ -31,3 +31,5 @@ program pure_byref_3
a = hoj() a = hoj()
if (.not. all(a == (/1, 2, 3/))) call abort() if (.not. all(a == (/1, 2, 3/))) call abort()
end program pure_byref_3 end program pure_byref_3
! { dg-final { cleanup-modules "huj_mod" } }
...@@ -11,3 +11,5 @@ contains ...@@ -11,3 +11,5 @@ contains
subroutine u subroutine u
end subroutine u end subroutine u
end module m end module m
! { dg-final { cleanup-modules "n m" } }
...@@ -30,3 +30,5 @@ contains ...@@ -30,3 +30,5 @@ contains
call bar(self, z) call bar(self, z)
end subroutine end subroutine
end end
! { dg-final { cleanup-modules "foo" } }
...@@ -30,3 +30,5 @@ contains ...@@ -30,3 +30,5 @@ contains
call bar_(self, z) call bar_(self, z)
end subroutine end subroutine
end end
! { dg-final { cleanup-modules "foo" } }
...@@ -16,3 +16,5 @@ module ice ...@@ -16,3 +16,5 @@ module ice
end subroutine bar end subroutine bar
end subroutine foo end subroutine foo
end module end module
! { dg-final { cleanup-modules "ice" } }
...@@ -11,3 +11,4 @@ character(4) :: b ...@@ -11,3 +11,4 @@ character(4) :: b
b = a b = a
end end
! { dg-final { cleanup-modules "m" } }
...@@ -6,3 +6,5 @@ module FLAGS ...@@ -6,3 +6,5 @@ module FLAGS
character :: at, dev character :: at, dev
equivalence ( encodings(1:1),at ), ( encodings(2:2),dev) equivalence ( encodings(1:1),at ), ( encodings(2:2),dev)
end module FLAGS end module FLAGS
! { dg-final { cleanup-modules "FLAGS" } }
...@@ -16,3 +16,5 @@ subroutine init ...@@ -16,3 +16,5 @@ subroutine init
use foo use foo
if (.not.allocated(bar)) call abort if (.not.allocated(bar)) call abort
end subroutine init end subroutine init
! { dg-final { cleanup-modules "foo" } }
...@@ -34,3 +34,5 @@ end module atest ...@@ -34,3 +34,5 @@ end module atest
call test (res) call test (res)
if (res%a.ne.42) call abort if (res%a.ne.42) call abort
end end
! { dg-final { cleanup-modules "mtyp atest" } }
...@@ -30,3 +30,5 @@ contains ...@@ -30,3 +30,5 @@ contains
v = x%f2(:) v = x%f2(:)
end subroutine foo end subroutine foo
end module mod2 end module mod2
! { dg-final { cleanup-modules "mod1 mod2" } }
...@@ -34,3 +34,4 @@ ...@@ -34,3 +34,4 @@
CALL TEST(x) ! { dg-error "Type/rank mismatch in argument" } CALL TEST(x) ! { dg-error "Type/rank mismatch in argument" }
END END
! { dg-final { cleanup-modules "T1 T2" } }
...@@ -99,3 +99,4 @@ contains ...@@ -99,3 +99,4 @@ contains
end subroutine foo end subroutine foo
END END
! { dg-final { cleanup-modules "global" } }
...@@ -83,3 +83,4 @@ contains ...@@ -83,3 +83,4 @@ contains
end subroutine foo end subroutine foo
END END
! { dg-final { cleanup-modules "global" } }
...@@ -44,5 +44,4 @@ ...@@ -44,5 +44,4 @@
solveCConvert = (/(real(i), i = 1, anzKomponenten)/) solveCConvert = (/(real(i), i = 1, anzKomponenten)/)
END FUNCTION solveCConvert END FUNCTION solveCConvert
! { dg-final { cleanup-modules "MODULE_CONC MODULE_THERMOCALC" } }
...@@ -19,3 +19,5 @@ CONTAINS ...@@ -19,3 +19,5 @@ CONTAINS
mtpcar%coo='a' !ICE was here mtpcar%coo='a' !ICE was here
END SUBROUTINE str_clan END SUBROUTINE str_clan
END MODULE END MODULE
! { dg-final { cleanup-modules "testcase tp_trace" } }
...@@ -33,3 +33,4 @@ program opshape ...@@ -33,3 +33,4 @@ program opshape
end program opshape end program opshape
! { dg-final { cleanup-modules "geometry" } }
...@@ -404,6 +404,13 @@ proc cleanup-saved-temps { } { ...@@ -404,6 +404,13 @@ proc cleanup-saved-temps { } {
} }
} }
# Remove files for specified Fortran modules.
proc cleanup-modules { modlist } {
foreach modname $modlist {
remove-build-file [string tolower $modname].mod
}
}
# We need to make sure that additional_* are cleared out after every # We need to make sure that additional_* are cleared out after every
# test. It is not enough to clear them out *before* the next test run # test. It is not enough to clear them out *before* the next test run
# because gcc-target-compile gets run directly from some .exp files # because gcc-target-compile gets run directly from some .exp files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment