Commit e2ab8b09 by Janus Weil

re PR fortran/40881 ([F03] warn for obsolescent features)

2009-08-02  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40881
	* decl.c (match_char_length): Warn about old-style character length
	declarations.
	* match.c (match_arithmetic_if,gfc_match_if): Modify warning message
	for arithmetic if.
	(gfc_match_goto): Warn about computed gotos.
	(gfc_match_return): Warn about alternate return.
	(gfc_match_st_function): Warn about statement functions.
	* resolve.c (resolve_fl_procedure): Modify warning message for
	assumed-length character functions.


2009-08-02  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40881
	* gfortran.dg/aliasing_dummy_1.f90: Add -std=legacy.
	* gfortran.dg/altreturn_3.f90: Ditto.
	* gfortran.dg/altreturn_5.f90: Ditto.
	* gfortran.dg/altreturn_6.f90: Ditto.
	* gfortran.dg/altreturn_7.f90: Ditto.
	* gfortran.dg/array_constructor_13.f90: Ditto.
	* gfortran.dg/arrayio_7.f90: Ditto.
	* gfortran.dg/arrayio_8.f90: Ditto.
	* gfortran.dg/assumed_charlen_function_3.f90: Modified warning message.
	* gfortran.dg/assumed_charlen_function_4.f90: Add -std=legacy.
	* gfortran.dg/assumed_charlen_function_5.f90: Modified warning message.
	* gfortran.dg/backspace_8.f: Add -std=legacy.
	* gfortran.dg/backspace_9.f: Ditto.
	* gfortran.dg/char_comparison_1.f: Ditto.
	* gfortran.dg/char_decl_1.f90: Ditto.
	* gfortran.dg/char_initialiser_actual.f90: Ditto.
	* gfortran.dg/char_pointer_assign.f90: Ditto.
	* gfortran.dg/char_pointer_dependency.f90: Ditto.
	* gfortran.dg/char_pointer_dummy.f90: Ditto.
	* gfortran.dg/char_pointer_func.f90: Ditto.
	* gfortran.dg/common_8.f90: Ditto.
	* gfortran.dg/constant_substring.f: Ditto.
	* gfortran.dg/data_char_2.f90: Ditto.
	* gfortran.dg/der_array_io_1.f90: Ditto.
	* gfortran.dg/der_array_io_2.f90: Ditto.
	* gfortran.dg/der_array_io_3.f90: Ditto.
	* gfortran.dg/der_io_3.f90: Ditto.
	* gfortran.dg/dev_null.F90: Ditto.
	* gfortran.dg/direct_io_2.f90: Ditto.
	* gfortran.dg/do_iterator_2.f90: Ditto.
	* gfortran.dg/e_d_fmt.f90: Ditto.
	* gfortran.dg/empty_format_1.f90: Ditto.
	* gfortran.dg/entry_17.f90: Modified warning message.
	* gfortran.dg/entry_7.f90: Add -std=legacy.
	* gfortran.dg/eor_1.f90: Ditto.
	* gfortran.dg/equiv_2.f90: Ditto.
	* gfortran.dg/equiv_constraint_2.f90: Use new-style character length.
	* gfortran.dg/equiv_substr.f90: Add -std=legacy.
	* gfortran.dg/extended_char_comparison_1.f: Ditto.
	* gfortran.dg/fmt_bz_bn_err.f: Ditto.
	* gfortran.dg/fmt_error_2.f90: Ditto.
	* gfortran.dg/fmt_read_bz_bn.f90: Ditto.
	* gfortran.dg/fmt_tl.f: Ditto.
	* gfortran.dg/fmt_white.f: Ditto.
	* gfortran.dg/func_derived_1.f90: Ditto.
	* gfortran.dg/g77_intrinsics_funcs.f: Ditto.
	* gfortran.dg/g77_intrinsics_sub.f: Ditto.
	* gfortran.dg/global_references_2.f90: Ditto.
	* gfortran.dg/hollerith_1.f90: Ditto.
	* gfortran.dg/hollerith.f90: Use new-style character length.
	* gfortran.dg/hollerith_f95.f90: Ditto.
	* gfortran.dg/ichar_1.f90: Add -std=legacy.
	* gfortran.dg/implicit_6.f90: Ditto.
	* gfortran.dg/implicit_9.f90: Ditto.
	* gfortran.dg/inquire_13.f90: Ditto.
	* gfortran.dg/inquire_5.f90: Ditto.
	* gfortran.dg/inquire_6.f90: Ditto.
	* gfortran.dg/inquire.f90: Ditto.
	* gfortran.dg/io_constraints_1.f90: Use new-style character length.
	* gfortran.dg/io_constraints_2.f90: Ditto.
	* gfortran.dg/list_read_2.f90: Add -std=legacy.
	* gfortran.dg/loc_2.f90: Ditto.
	* gfortran.dg/logical_1.f90: Ditto.
	* gfortran.dg/longline.f: Ditto.
	* gfortran.dg/merge_char_1.f90: Ditto.
	* gfortran.dg/namelist_12.f: Ditto.
	* gfortran.dg/namelist_14.f90: Ditto.
	* gfortran.dg/namelist_18.f90: Ditto.
	* gfortran.dg/namelist_19.f90: Ditto.
	* gfortran.dg/namelist_21.f90: Ditto.
	* gfortran.dg/namelist_22.f90: Ditto.
	* gfortran.dg/namelist_37.f90: Ditto.
	* gfortran.dg/namelist_54.f90: Ditto.
	* gfortran.dg/namelist_55.f90: Ditto.
	* gfortran.dg/namelist_empty.f90: Ditto.
	* gfortran.dg/namelist_use.f90: Use new-style character length.
	* gfortran.dg/namelist_use_only.f90: Add -std=legacy.
	* gfortran.dg/nested_modules_4.f90: Ditto.
	* gfortran.dg/nested_modules_5.f90: Ditto.
	* gfortran.dg/open-options-blanks.f: Ditto.
	* gfortran.dg/output_exponents_1.f90: Ditto.
	* gfortran.dg/parens_5.f90: Ditto.
	* gfortran.dg/parens_6.f90: Ditto.
	* gfortran.dg/parent_result_ref_2.f90: Modified warning message.
	* gfortran.dg/pointer_function_actual_1.f90: Add -std=legacy.
	* gfortran.dg/pr15129.f90: Ditto.
	* gfortran.dg/pr15332.f: Ditto.
	* gfortran.dg/pr16597.f90: Ditto.
	* gfortran.dg/pr17143.f90: Ditto.
	* gfortran.dg/pr17164.f90: Ditto.
	* gfortran.dg/pr17229.f: Modified warning message.
	* gfortran.dg/pr18210.f90: Add -std=legacy.
	* gfortran.dg/pr19155.f: Ditto.
	* gfortran.dg/pr20086.f90: Ditto.
	* gfortran.dg/pr20124.f90: Ditto.
	* gfortran.dg/pr20755.f: Ditto.
	* gfortran.dg/pr20865.f90: Ditto.
	* gfortran.dg/pr20950.f: Ditto.
	* gfortran.dg/pr21730.f: Ditto.
	* gfortran.dg/pr22491.f: Ditto.
	* gfortran.dg/pr29713.f90: Ditto.
	* gfortran.dg/print_parentheses_1.f: Ditto.
	* gfortran.dg/print_parentheses_2.f90: Ditto.
	* gfortran.dg/proc_assign_1.f90: Ditto.
	* gfortran.dg/proc_decl_1.f90: Ditto.
	* gfortran.dg/proc_ptr_17.f90: Add dg-warning.
	* gfortran.dg/read_eor.f90: : Add -std=legacy.
	* gfortran.dg/read_float_1.f90: Ditto.
	* gfortran.dg/read_logical.f90: Ditto.
	* gfortran.dg/recursive_statement_functions.f90: Ditto.
	* gfortran.dg/return_1.f90: Ditto.
	* gfortran.dg/rewind_1.f90: Ditto.
	* gfortran.dg/runtime_warning_1.f90: Use new-style character length.
	* gfortran.dg/scalar_return_1.f90: Add -std=legacy.
	* gfortran.dg/stfunc_1.f90: Ditto.
	* gfortran.dg/stfunc_3.f90: Ditto.
	* gfortran.dg/stfunc_4.f90: Ditto.
	* gfortran.dg/stfunc_6.f90: Ditto.
	* gfortran.dg/streamio_2.f90: Ditto.
	* gfortran.dg/string_ctor_1.f90: Ditto.
	* gfortran.dg/string_null_compare_1.f: Ditto.
	* gfortran.dg/substr_6.f90: Ditto.
	* gfortran.dg/tl_editing.f90: Ditto.
	* gfortran.dg/unf_io_convert_1.f90: Use new-style character length.
	* gfortran.dg/warnings_are_errors_1.f90: Modified warning message.
	* gfortran.dg/x_slash_1.f: Add -std=legacy.
	* gfortran.dg/g77/1832.f: Ditto.
	* gfortran.dg/g77/19981216-0.f Ditto.
	* gfortran.dg/g77/19990525-0.f: Ditto.
	* gfortran.dg/g77/19990826-2.f: Ditto.
	* gfortran.dg/g77/20000630-2.f: Ditto.
	* gfortran.dg/g77/20010116.f: Ditto.
	* gfortran.dg/g77/20010519-1.f: Use new-style character length.
	* gfortran.dg/g77/980419-2.f: Add -std=legacy.
	* gfortran.dg/g77/980520-1.f: Ditto.
	* gfortran.dg/g77/check0.f: Ditto.
	* gfortran.dg/g77/cpp3.F: Ditto.
	* gfortran.dg/g77/cpp4.F: Use new-style character length.
	* gfortran.dg/g77/f77-edit-i-in.f: Add -std=legacy.
	* gfortran.dg/g77/f77-edit-t-in.f: Ditto.
	* gfortran.dg/g77/short.f: Ditto.

From-SVN: r150349
parent 657e81c7
2009-08-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/40881
* decl.c (match_char_length): Warn about old-style character length
declarations.
* match.c (match_arithmetic_if,gfc_match_if): Modify warning message
for arithmetic if.
(gfc_match_goto): Warn about computed gotos.
(gfc_match_return): Warn about alternate return.
(gfc_match_st_function): Warn about statement functions.
* resolve.c (resolve_fl_procedure): Modify warning message for
assumed-length character functions.
2009-08-01 Paul Thomas <pault@gcc.gnu.org> 2009-08-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40011 PR fortran/40011
......
...@@ -655,6 +655,9 @@ match_char_length (gfc_expr **expr) ...@@ -655,6 +655,9 @@ match_char_length (gfc_expr **expr)
if (m == MATCH_YES) if (m == MATCH_YES)
{ {
if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
"Old-style character length at %C") == FAILURE)
return MATCH_ERROR;
*expr = gfc_int_expr (length); *expr = gfc_int_expr (length);
return m; return m;
} }
......
...@@ -1383,8 +1383,8 @@ match_arithmetic_if (void) ...@@ -1383,8 +1383,8 @@ match_arithmetic_if (void)
return MATCH_ERROR; return MATCH_ERROR;
} }
if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent: arithmetic IF statement " if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Arithmetic IF "
"at %C") == FAILURE) "statement at %C") == FAILURE)
return MATCH_ERROR; return MATCH_ERROR;
new_st.op = EXEC_ARITHMETIC_IF; new_st.op = EXEC_ARITHMETIC_IF;
...@@ -1464,7 +1464,7 @@ gfc_match_if (gfc_statement *if_type) ...@@ -1464,7 +1464,7 @@ gfc_match_if (gfc_statement *if_type)
return MATCH_ERROR; return MATCH_ERROR;
} }
if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent: arithmetic IF " if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Arithmetic IF "
"statement at %C") == FAILURE) "statement at %C") == FAILURE)
return MATCH_ERROR; return MATCH_ERROR;
...@@ -2180,6 +2180,10 @@ gfc_match_goto (void) ...@@ -2180,6 +2180,10 @@ gfc_match_goto (void)
if (gfc_match (" %e%t", &expr) != MATCH_YES) if (gfc_match (" %e%t", &expr) != MATCH_YES)
goto syntax; goto syntax;
if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Computed GOTO "
"at %C") == FAILURE)
return MATCH_ERROR;
/* At this point, a computed GOTO has been fully matched and an /* At this point, a computed GOTO has been fully matched and an
equivalent SELECT statement constructed. */ equivalent SELECT statement constructed. */
...@@ -2580,6 +2584,10 @@ gfc_match_return (void) ...@@ -2580,6 +2584,10 @@ gfc_match_return (void)
goto cleanup; goto cleanup;
} }
if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Alternate RETURN "
"at %C") == FAILURE)
return MATCH_ERROR;
if (gfc_current_form == FORM_FREE) if (gfc_current_form == FORM_FREE)
{ {
/* The following are valid, so we can't require a blank after the /* The following are valid, so we can't require a blank after the
...@@ -3517,6 +3525,10 @@ gfc_match_st_function (void) ...@@ -3517,6 +3525,10 @@ gfc_match_st_function (void)
sym->value = expr; sym->value = expr;
if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
"Statement function at %C") == FAILURE)
return MATCH_ERROR;
return MATCH_YES; return MATCH_YES;
undo_error: undo_error:
......
...@@ -8289,8 +8289,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) ...@@ -8289,8 +8289,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
/* Appendix B.2 of the standard. Contained functions give an /* Appendix B.2 of the standard. Contained functions give an
error anyway. Fixed-form is likely to be F77/legacy. */ error anyway. Fixed-form is likely to be F77/legacy. */
if (!sym->attr.contained && gfc_current_form != FORM_FIXED) if (!sym->attr.contained && gfc_current_form != FORM_FIXED)
gfc_notify_std (GFC_STD_F95_OBS, "CHARACTER(*) function " gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
"'%s' at %L is obsolescent in fortran 95", "CHARACTER(*) function '%s' at %L",
sym->name, &sym->declared_at); sym->name, &sym->declared_at);
} }
......
2009-08-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/40881
* gfortran.dg/aliasing_dummy_1.f90: Add -std=legacy.
* gfortran.dg/altreturn_3.f90: Ditto.
* gfortran.dg/altreturn_5.f90: Ditto.
* gfortran.dg/altreturn_6.f90: Ditto.
* gfortran.dg/altreturn_7.f90: Ditto.
* gfortran.dg/array_constructor_13.f90: Ditto.
* gfortran.dg/arrayio_7.f90: Ditto.
* gfortran.dg/arrayio_8.f90: Ditto.
* gfortran.dg/assumed_charlen_function_3.f90: Modified warning message.
* gfortran.dg/assumed_charlen_function_4.f90: Add -std=legacy.
* gfortran.dg/assumed_charlen_function_5.f90: Modified warning message.
* gfortran.dg/backspace_8.f: Add -std=legacy.
* gfortran.dg/backspace_9.f: Ditto.
* gfortran.dg/char_comparison_1.f: Ditto.
* gfortran.dg/char_decl_1.f90: Ditto.
* gfortran.dg/char_initialiser_actual.f90: Ditto.
* gfortran.dg/char_pointer_assign.f90: Ditto.
* gfortran.dg/char_pointer_dependency.f90: Ditto.
* gfortran.dg/char_pointer_dummy.f90: Ditto.
* gfortran.dg/char_pointer_func.f90: Ditto.
* gfortran.dg/common_8.f90: Ditto.
* gfortran.dg/constant_substring.f: Ditto.
* gfortran.dg/data_char_2.f90: Ditto.
* gfortran.dg/der_array_io_1.f90: Ditto.
* gfortran.dg/der_array_io_2.f90: Ditto.
* gfortran.dg/der_array_io_3.f90: Ditto.
* gfortran.dg/der_io_3.f90: Ditto.
* gfortran.dg/dev_null.F90: Ditto.
* gfortran.dg/direct_io_2.f90: Ditto.
* gfortran.dg/do_iterator_2.f90: Ditto.
* gfortran.dg/e_d_fmt.f90: Ditto.
* gfortran.dg/empty_format_1.f90: Ditto.
* gfortran.dg/entry_17.f90: Modified warning message.
* gfortran.dg/entry_7.f90: Add -std=legacy.
* gfortran.dg/eor_1.f90: Ditto.
* gfortran.dg/equiv_2.f90: Ditto.
* gfortran.dg/equiv_constraint_2.f90: Use new-style character length.
* gfortran.dg/equiv_substr.f90: Add -std=legacy.
* gfortran.dg/extended_char_comparison_1.f: Ditto.
* gfortran.dg/fmt_bz_bn_err.f: Ditto.
* gfortran.dg/fmt_error_2.f90: Ditto.
* gfortran.dg/fmt_read_bz_bn.f90: Ditto.
* gfortran.dg/fmt_tl.f: Ditto.
* gfortran.dg/fmt_white.f: Ditto.
* gfortran.dg/func_derived_1.f90: Ditto.
* gfortran.dg/g77_intrinsics_funcs.f: Ditto.
* gfortran.dg/g77_intrinsics_sub.f: Ditto.
* gfortran.dg/global_references_2.f90: Ditto.
* gfortran.dg/hollerith_1.f90: Ditto.
* gfortran.dg/hollerith.f90: Use new-style character length.
* gfortran.dg/hollerith_f95.f90: Ditto.
* gfortran.dg/ichar_1.f90: Add -std=legacy.
* gfortran.dg/implicit_6.f90: Ditto.
* gfortran.dg/implicit_9.f90: Ditto.
* gfortran.dg/inquire_13.f90: Ditto.
* gfortran.dg/inquire_5.f90: Ditto.
* gfortran.dg/inquire_6.f90: Ditto.
* gfortran.dg/inquire.f90: Ditto.
* gfortran.dg/io_constraints_1.f90: Use new-style character length.
* gfortran.dg/io_constraints_2.f90: Ditto.
* gfortran.dg/list_read_2.f90: Add -std=legacy.
* gfortran.dg/loc_2.f90: Ditto.
* gfortran.dg/logical_1.f90: Ditto.
* gfortran.dg/longline.f: Ditto.
* gfortran.dg/merge_char_1.f90: Ditto.
* gfortran.dg/namelist_12.f: Ditto.
* gfortran.dg/namelist_14.f90: Ditto.
* gfortran.dg/namelist_18.f90: Ditto.
* gfortran.dg/namelist_19.f90: Ditto.
* gfortran.dg/namelist_21.f90: Ditto.
* gfortran.dg/namelist_22.f90: Ditto.
* gfortran.dg/namelist_37.f90: Ditto.
* gfortran.dg/namelist_54.f90: Ditto.
* gfortran.dg/namelist_55.f90: Ditto.
* gfortran.dg/namelist_empty.f90: Ditto.
* gfortran.dg/namelist_use.f90: Use new-style character length.
* gfortran.dg/namelist_use_only.f90: Add -std=legacy.
* gfortran.dg/nested_modules_4.f90: Ditto.
* gfortran.dg/nested_modules_5.f90: Ditto.
* gfortran.dg/open-options-blanks.f: Ditto.
* gfortran.dg/output_exponents_1.f90: Ditto.
* gfortran.dg/parens_5.f90: Ditto.
* gfortran.dg/parens_6.f90: Ditto.
* gfortran.dg/parent_result_ref_2.f90: Modified warning message.
* gfortran.dg/pointer_function_actual_1.f90: Add -std=legacy.
* gfortran.dg/pr15129.f90: Ditto.
* gfortran.dg/pr15332.f: Ditto.
* gfortran.dg/pr16597.f90: Ditto.
* gfortran.dg/pr17143.f90: Ditto.
* gfortran.dg/pr17164.f90: Ditto.
* gfortran.dg/pr17229.f: Modified warning message.
* gfortran.dg/pr18210.f90: Add -std=legacy.
* gfortran.dg/pr19155.f: Ditto.
* gfortran.dg/pr20086.f90: Ditto.
* gfortran.dg/pr20124.f90: Ditto.
* gfortran.dg/pr20755.f: Ditto.
* gfortran.dg/pr20865.f90: Ditto.
* gfortran.dg/pr20950.f: Ditto.
* gfortran.dg/pr21730.f: Ditto.
* gfortran.dg/pr22491.f: Ditto.
* gfortran.dg/pr29713.f90: Ditto.
* gfortran.dg/print_parentheses_1.f: Ditto.
* gfortran.dg/print_parentheses_2.f90: Ditto.
* gfortran.dg/proc_assign_1.f90: Ditto.
* gfortran.dg/proc_decl_1.f90: Ditto.
* gfortran.dg/proc_ptr_17.f90: Add dg-warning.
* gfortran.dg/read_eor.f90: : Add -std=legacy.
* gfortran.dg/read_float_1.f90: Ditto.
* gfortran.dg/read_logical.f90: Ditto.
* gfortran.dg/recursive_statement_functions.f90: Ditto.
* gfortran.dg/return_1.f90: Ditto.
* gfortran.dg/rewind_1.f90: Ditto.
* gfortran.dg/runtime_warning_1.f90: Use new-style character length.
* gfortran.dg/scalar_return_1.f90: Add -std=legacy.
* gfortran.dg/stfunc_1.f90: Ditto.
* gfortran.dg/stfunc_3.f90: Ditto.
* gfortran.dg/stfunc_4.f90: Ditto.
* gfortran.dg/stfunc_6.f90: Ditto.
* gfortran.dg/streamio_2.f90: Ditto.
* gfortran.dg/string_ctor_1.f90: Ditto.
* gfortran.dg/string_null_compare_1.f: Ditto.
* gfortran.dg/substr_6.f90: Ditto.
* gfortran.dg/tl_editing.f90: Ditto.
* gfortran.dg/unf_io_convert_1.f90: Use new-style character length.
* gfortran.dg/warnings_are_errors_1.f90: Modified warning message.
* gfortran.dg/x_slash_1.f: Add -std=legacy.
* gfortran.dg/g77/1832.f: Ditto.
* gfortran.dg/g77/19981216-0.f Ditto.
* gfortran.dg/g77/19990525-0.f: Ditto.
* gfortran.dg/g77/19990826-2.f: Ditto.
* gfortran.dg/g77/20000630-2.f: Ditto.
* gfortran.dg/g77/20010116.f: Ditto.
* gfortran.dg/g77/20010519-1.f: Use new-style character length.
* gfortran.dg/g77/980419-2.f: Add -std=legacy.
* gfortran.dg/g77/980520-1.f: Ditto.
* gfortran.dg/g77/check0.f: Ditto.
* gfortran.dg/g77/cpp3.F: Ditto.
* gfortran.dg/g77/cpp4.F: Use new-style character length.
* gfortran.dg/g77/f77-edit-i-in.f: Add -std=legacy.
* gfortran.dg/g77/f77-edit-t-in.f: Ditto.
* gfortran.dg/g77/short.f: Ditto.
2009-08-01 Adam Nemet <anemet@caviumnetworks.com> 2009-08-01 Adam Nemet <anemet@caviumnetworks.com>
* gcc.target/mips/ext-3.c: Add NOMIPS16. * gcc.target/mips/ext-3.c: Add NOMIPS16.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! This tests the fix for PR24276, which originated from the Loren P. Meissner example, ! This tests the fix for PR24276, which originated from the Loren P. Meissner example,
! Array_List. The PR concerns dummy argument aliassing of components of arrays of derived ! Array_List. The PR concerns dummy argument aliassing of components of arrays of derived
! types as arrays of the type of the component. gfortran would compile and run this ! types as arrays of the type of the component. gfortran would compile and run this
...@@ -61,4 +63,5 @@ contains ...@@ -61,4 +63,5 @@ contains
write (slist(1,1), '(2hi=,i3)') i write (slist(1,1), '(2hi=,i3)') i
end subroutine foo3 end subroutine foo3
end program test_lex end program test_lex
\ No newline at end of file
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Tests the fix for PR30236, which was due to alternate returns ! Tests the fix for PR30236, which was due to alternate returns
! in generic interfaces causing a segfault. They now work ! in generic interfaces causing a segfault. They now work
! correctly. ! correctly.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Tests the fix for PR31483, in which dummy argument procedures ! Tests the fix for PR31483, in which dummy argument procedures
! produced an ICE if they had an alternate return. ! produced an ICE if they had an alternate return.
! !
......
! { dg-do compile }
! { dg-options "-std=legacy" }
!
! PR 32938 ! PR 32938
subroutine r (*) subroutine r (*)
integer(kind=8) :: i integer(kind=8) :: i
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
! !
! PR 40848: [4.5 Regression] ICE with alternate returns ! PR 40848: [4.5 Regression] ICE with alternate returns
! !
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! Tests patch for PR29431, which arose from PR29373. ! Tests patch for PR29431, which arose from PR29373.
! !
! Contributed by Tobias Schlueter <tobi@gcc.gnu.org> ! Contributed by Tobias Schlueter <tobi@gcc.gnu.org>
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR24224 Test formatted input/output to/from character arrays with strides ! PR24224 Test formatted input/output to/from character arrays with strides
! other than 1. Test that reading stops at the end of the current record. ! other than 1. Test that reading stops at the end of the current record.
! Contributed by Jerry DeLisle <jvdelisle@verizon.net>. ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR28339, This test checks that internal unit array I/O handles a full record ! PR28339, This test checks that internal unit array I/O handles a full record
! and advances to the next record properly. Test case derived from PR ! and advances to the next record properly. Test case derived from PR
! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org> ! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
! !
! Contributed by Paul Thomas <pault@gcc.gnu.org> ! Contributed by Paul Thomas <pault@gcc.gnu.org>
! !
function is_OK (ch) ! { dg-warning "is obsolescent in fortran 95" } function is_OK (ch) ! { dg-warning "Obsolescent feature" }
character(*) is_OK, ch ! OK in an external function character(*) is_OK, ch ! OK in an external function
is_OK = ch is_OK = ch
end function is_OK end function is_OK
! The warning occurs twice for the next line; for 'more_OK' and for 'fcn'; ! The warning occurs twice for the next line; for 'more_OK' and for 'fcn';
function more_OK (ch, fcn) ! { dg-warning "is obsolescent in fortran 95" } function more_OK (ch, fcn) ! { dg-warning "Obsolescent feature" }
character(*) more_OK, ch character(*) more_OK, ch
character (*), external :: fcn ! OK as a dummy argument character (*), external :: fcn ! OK as a dummy argument
more_OK = fcn (ch) more_OK = fcn (ch)
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! Tests the fix for PR28600 in which the declaration for the ! Tests the fix for PR28600 in which the declaration for the
! character length n, would be given the DECL_CONTEXT of 'gee' ! character length n, would be given the DECL_CONTEXT of 'gee'
! thus causing an ICE. ! thus causing an ICE.
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
! !
! Contributed by Paul Thomas <pault@gcc.gnu.org> ! Contributed by Paul Thomas <pault@gcc.gnu.org>
! !
character(*) function charrext (n) ! { dg-warning "is obsolescent in fortran 95" } character(*) function charrext (n) ! { dg-warning "Obsolescent feature" }
character(26) :: alpha ="abcdefghijklmnopqrstuvwxyz" character(26) :: alpha ="abcdefghijklmnopqrstuvwxyz"
charrext = alpha (1:n) charrext = alpha (1:n)
end function charrext end function charrext
character(26), external :: charrext character(26), external :: charrext
interface interface
integer(4) function test(charr, i) ! { dg-warning "is obsolescent in fortran 95" } integer(4) function test(charr, i) ! { dg-warning "Obsolescent feature" }
character(*), external :: charr character(*), external :: charr
integer :: i integer :: i
end function test end function test
...@@ -23,7 +23,7 @@ end function charrext ...@@ -23,7 +23,7 @@ end function charrext
m = ctest (charrext, 27 - j) m = ctest (charrext, 27 - j)
end do end do
contains contains
integer(4) function ctest(charr, i) ! { dg-warning "is obsolescent in fortran 95" } integer(4) function ctest(charr, i) ! { dg-warning "Obsolescent feature" }
character(*) :: charr character(*) :: charr
integer :: i integer :: i
print *, charr(i) print *, charr(i)
...@@ -31,7 +31,7 @@ contains ...@@ -31,7 +31,7 @@ contains
end function ctest end function ctest
end end
integer(4) function test(charr, i) ! { dg-warning "is obsolescent in fortran 95" } integer(4) function test(charr, i) ! { dg-warning "Obsolescent feature" }
character(*) :: charr character(*) :: charr
integer :: i integer :: i
print *, charr(i) print *, charr(i)
......
C { dg-do run } C { dg-do run }
C { dg-options "-std=legacy" }
C
C PR libfortran/31618 - backspace after an error didn't work. C PR libfortran/31618 - backspace after an error didn't work.
program main program main
character*78 msg character*78 msg
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR32235 incorrectly position text file after backspace ! PR32235 incorrectly position text file after backspace
! Test case from PR, prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> ! Test case from PR, prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
program main program main
......
C { dg-do run } C { dg-do run }
C { dg-options "-std=legacy" }
C
C PR 30525 - comparisons with padded spaces were done C PR 30525 - comparisons with padded spaces were done
C signed. C signed.
program main program main
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! PR32644 "CHARACTER*1, c" produces "Unclassifiable statement" ! PR32644 "CHARACTER*1, c" produces "Unclassifiable statement"
program f program f
character*1, c character*1, c
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Tests passing of character array initialiser as actual argument. ! Tests passing of character array initialiser as actual argument.
! Fixes PR18109. ! Fixes PR18109.
! Contributed by Paul Thomas pault@gcc.gnu.org ! Contributed by Paul Thomas pault@gcc.gnu.org
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
program char_pointer_assign program char_pointer_assign
! Test character pointer assignments, required ! Test character pointer assignments, required
! to fix PR18890 and PR21297 ! to fix PR18890 and PR21297
...@@ -38,4 +40,5 @@ program char_pointer_assign ...@@ -38,4 +40,5 @@ program char_pointer_assign
if (any (t2 /= "lnmo")) call abort () if (any (t2 /= "lnmo")) call abort ()
if (any (c2 /= "onml")) call abort () if (any (c2 /= "onml")) call abort ()
deallocate (c3, c4) deallocate (c3, c4)
end program char_pointer_assign end program char_pointer_assign
\ No newline at end of file
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Test assignments from character pointer functions with dependencies ! Test assignments from character pointer functions with dependencies
! are correctly resolved. ! are correctly resolved.
! Provided by Paul Thomas pault@gcc.gnu.org ! Provided by Paul Thomas pault@gcc.gnu.org
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
program char_pointer_dummy program char_pointer_dummy
! Test character pointer dummy arguments, required ! Test character pointer dummy arguments, required
! to fix PR16939 and PR18689 ! to fix PR16939 and PR18689
...@@ -30,4 +32,5 @@ contains ...@@ -30,4 +32,5 @@ contains
character*4, pointer :: ac1(:) character*4, pointer :: ac1(:)
if (ac1(1) /= "wxyz") call abort () if (ac1(1) /= "wxyz") call abort ()
end subroutine afoo end subroutine afoo
end program char_pointer_dummy end program char_pointer_dummy
\ No newline at end of file
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
program char_pointer_func program char_pointer_func
! Test assignments from character pointer functions, required ! Test assignments from character pointer functions, required
! to fix PR17192 and PR17202 ! to fix PR17192 and PR17202
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
! !
! PR fortran/25062 ! PR fortran/25062
! !
......
! Simplify constant substring ! Simplify constant substring
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
character*2 a character*2 a
character*4 b character*4 b
character*6 c character*6 c
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Test that getting a character from a ! Test that getting a character from a
! string data works. ! string data works.
......
! Test IO of arrays of integers in derived types ! Test IO of arrays of integers in derived types
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
program main program main
character* 10000 :: buf1, buf2 character* 10000 :: buf1, buf2
......
! Test IO of arrays in derived type arrays ! Test IO of arrays in derived type arrays
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
program main program main
character *1000 buf1, buf2 character *1000 buf1, buf2
......
! Test IO of character arrays in derived types. ! Test IO of character arrays in derived types.
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
program main program main
character*1000 buf1, buf2 character*1000 buf1, buf2
type :: foo_type type :: foo_type
......
! { dg-do compile }
! { dg-options "-std=legacy" }
!
! PR23843 ! PR23843
! Make sure derived type I/O with PRIVATE components works where it's allowed ! Make sure derived type I/O with PRIVATE components works where it's allowed
module m1 module m1
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! pr19478 read from /dev/null ! pr19478 read from /dev/null
! Thomas.Koenig@online.de ! Thomas.Koenig@online.de
#if defined _WIN32 #if defined _WIN32
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
! !
! this testcase derived from NIST test FM413.FOR ! this testcase derived from NIST test FM413.FOR
! tests writing direct access files in ascending and descending ! tests writing direct access files in ascending and descending
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Tests the fix for pr32613 - see: ! Tests the fix for pr32613 - see:
! http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/495c154ee188d7f1/ea292134fe68b1d0#ea292134fe68b1d0 ! http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/495c154ee188d7f1/ea292134fe68b1d0#ea292134fe68b1d0
! !
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Verify that the D format uses 'D' as the exponent character. ! Verify that the D format uses 'D' as the exponent character.
! " " " E " " 'E' " " " " ! " " " E " " 'E' " " " "
CHARACTER*10 c1, c2 CHARACTER*10 c1, c2
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 17709 ! PR 17709
! We weren't resetting the internal EOR flag correctly, so the second read ! We weren't resetting the internal EOR flag correctly, so the second read
! wasn't advancing to the next line. ! wasn't advancing to the next line.
......
...@@ -17,19 +17,19 @@ entry bar2() ...@@ -17,19 +17,19 @@ entry bar2()
bar2 = "" bar2 = ""
end function test2 end function test2
function test3() ! { dg-warning "is obsolescent" } function test3() ! { dg-warning "Obsolescent feature" }
character(*) :: test3 character(*) :: test3
character(*) :: bar3 ! { dg-warning "is obsolescent" } character(*) :: bar3 ! { dg-warning "Obsolescent feature" }
test3 = "" test3 = ""
return return
entry bar3() entry bar3()
bar3 = "" bar3 = ""
end function test3 ! { dg-warning "is obsolescent" } end function test3 ! { dg-warning "Obsolescent feature" }
function test4(n) ! { dg-error "returning variables of different string lengths" } function test4(n) ! { dg-error "returning variables of different string lengths" }
integer :: n integer :: n
character(n) :: test4 character(n) :: test4
character(*) :: bar4 ! { dg-warning "is obsolescent" } character(*) :: bar4 ! { dg-warning "Obsolescent feature" }
test4 = "" test4 = ""
return return
entry bar4() entry bar4()
...@@ -45,11 +45,11 @@ entry bar5() ...@@ -45,11 +45,11 @@ entry bar5()
bar5 = "" bar5 = ""
end function test5 end function test5
function test6() ! { dg-warning "is obsolescent|returning variables of different string lengths" } function test6() ! { dg-warning "Obsolescent feature|returning variables of different string lengths" }
character(*) :: test6 character(*) :: test6
character(2) :: bar6 character(2) :: bar6
test6 = "" test6 = ""
return return
entry bar6() entry bar6()
bar6 = "" bar6 = ""
end function test6 ! { dg-warning "is obsolescent" } end function test6 ! { dg-warning "Obsolescent feature" }
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! Check that PR20877 and PR25047 are fixed by the patch for ! Check that PR20877 and PR25047 are fixed by the patch for
! PR24558. Both modules would emit the error: ! PR24558. Both modules would emit the error:
! insert_bbt(): Duplicate key found! ! insert_bbt(): Duplicate key found!
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 19451: The test for advance='NO' with eor used to be reversed. ! PR 19451: The test for advance='NO' with eor used to be reversed.
program main program main
character*2 c character*2 c
......
! { dg-do compile }
! { dg-options "-std=legacy" }
!
subroutine broken_equiv1 subroutine broken_equiv1
character*4 h character*4 h
character*3 i character*3 i
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
type :: char_type type :: char_type
sequence sequence
character*4 :: ch character(4) :: ch
character*4 :: cha (6) character(4) :: cha (6)
end type char_type end type char_type
type (char_type) :: my_char type (char_type) :: my_char
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
type :: mixed_type type :: mixed_type
sequence sequence
integer :: i(4) integer :: i(4)
character*4 :: cha (6) character(4) :: cha (6)
end type mixed_type end type mixed_type
type (mixed_type) :: my_mixed, thy_mixed type (mixed_type) :: my_mixed, thy_mixed
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
! !
! PR fortran/34557 ! PR fortran/34557
! !
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 27715 - the front end and the library used to have different ideas ! PR 27715 - the front end and the library used to have different ideas
! about ordering for characters whose encoding is above 127. ! about ordering for characters whose encoding is above 127.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR38772 r143102 reveals missed error checking on floating point reads. ! PR38772 r143102 reveals missed error checking on floating point reads.
! Test case contributed by Jack Howarth. ! Test case contributed by Jack Howarth.
program badread program badread
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! PR 33269: we used to not simplify format strings before checking if ! PR 33269: we used to not simplify format strings before checking if
! they were valid, leading to a missed error. ! they were valid, leading to a missed error.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Test various uses of BZ and BN format specifiers. ! Test various uses of BZ and BN format specifiers.
! Portions inspired by NIST F77 testsuite FM711.f ! Portions inspired by NIST F77 testsuite FM711.f
! Contributed by jvdelisle@verizon.net ! Contributed by jvdelisle@verizon.net
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR25631 Check that TL editing works for special case of no bytes written yet. ! PR25631 Check that TL editing works for special case of no bytes written yet.
! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org> ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
real x real x
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR24268 Test case derived from example given by Iwan Kawrakow ! PR24268 Test case derived from example given by Iwan Kawrakow
! Embedded spaces in format strings should be ignored. ! Embedded spaces in format strings should be ignored.
! Prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> ! Prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 17244 ! PR 17244
! verifies that functions returning derived type work ! verifies that functions returning derived type work
module m module m
......
c { dg-do run } c { dg-do run }
! { dg-options "-std=legacy" }
!
character*5 string character*5 string
write(string, *) "a " write(string, *) "a "
if (string .ne. ' a') call abort if (string .ne. ' a') call abort
......
c { dg-do compile } c { dg-do compile }
c { dg-options "-std=legacy" }
c
* Resent-From: Craig Burley <burley@gnu.org> * Resent-From: Craig Burley <burley@gnu.org>
* Resent-To: craig@jcb-sc.com * Resent-To: craig@jcb-sc.com
* X-Delivered: at request of burley on mescaline.gnu.org * X-Delivered: at request of burley on mescaline.gnu.org
......
c { dg-do compile } c { dg-do compile }
c { dg-options "-std=legacy" }
c
* Mailing-List: contact egcs-bugs-help@egcs.cygnus.com; run by ezmlm * Mailing-List: contact egcs-bugs-help@egcs.cygnus.com; run by ezmlm
* Precedence: bulk * Precedence: bulk
* Sender: owner-egcs-bugs@egcs.cygnus.com * Sender: owner-egcs-bugs@egcs.cygnus.com
......
c { dg-do run } c { dg-do run }
c { dg-options "-std=legacy" }
c
* From: "Billinghurst, David (RTD)" <David.Billinghurst@riotinto.com.au> * From: "Billinghurst, David (RTD)" <David.Billinghurst@riotinto.com.au>
* Subject: RE: single precision complex bug in g77 - was Testing g77 with LA * Subject: RE: single precision complex bug in g77 - was Testing g77 with LA
* PACK 3.0 * PACK 3.0
......
c { dg-do compile } c { dg-do compile }
c { dg-options "-std=legacy" }
c
SUBROUTINE CHOUT(CHR,ICNT) SUBROUTINE CHOUT(CHR,ICNT)
C ICE: failed assertion `expr != NULL' C ICE: failed assertion `expr != NULL'
C Reduced version of GNATS PR fortran/329 from trond.bo@dnmi.no C Reduced version of GNATS PR fortran/329 from trond.bo@dnmi.no
......
c { dg-do run } c { dg-do run }
c { dg-options "-std=legacy" }
c
* *
* Derived from LAPACK 3.0 routine CHGEQZ * Derived from LAPACK 3.0 routine CHGEQZ
* Fails on i686-pc-cygwin with gcc-2.97 snapshots at -O2 and higher * Fails on i686-pc-cygwin with gcc-2.97 snapshots at -O2 and higher
......
...@@ -340,10 +340,10 @@ C..##IF ACE ...@@ -340,10 +340,10 @@ C..##IF ACE
C..##ENDIF C..##ENDIF
C..##IF ADUMB C..##IF ADUMB
C..##ENDIF C..##ENDIF
CHARACTER*4 GTRMA, NEXTA4, CURRA4 CHARACTER(4) GTRMA, NEXTA4, CURRA4
CHARACTER*6 NEXTA6 CHARACTER(6) NEXTA6
CHARACTER*8 NEXTA8 CHARACTER(8) NEXTA8
CHARACTER*20 NEXT20 CHARACTER(20) NEXT20
INTEGER ALLCHR, ALLSTK, ALLHP, DECODI, FIND52, INTEGER ALLCHR, ALLSTK, ALLHP, DECODI, FIND52,
* GETATN, GETRES, GETRSN, GETSEG, GTRMI, I4VAL, * GETATN, GETRES, GETRSN, GETSEG, GTRMI, I4VAL,
* ICHAR4, ICMP16, ILOGI4, INDX, INDXA, INDXAF, * ICHAR4, ICMP16, ILOGI4, INDX, INDXA, INDXAF,
...@@ -390,11 +390,11 @@ C..##ENDIF ...@@ -390,11 +390,11 @@ C..##ENDIF
C..##IF MMFF C..##IF MMFF
INTEGER LEN_TRIM INTEGER LEN_TRIM
EXTERNAL LEN_TRIM EXTERNAL LEN_TRIM
CHARACTER*4 AtName CHARACTER(4) AtName
external AtName external AtName
CHARACTER*8 ElementName CHARACTER(8) ElementName
external ElementName external ElementName
CHARACTER*10 QNAME CHARACTER(10) QNAME
external QNAME external QNAME
integer IATTCH, IBORDR, CONN12, CONN13, CONN14 integer IATTCH, IBORDR, CONN12, CONN13, CONN14
integer LEQUIV, LPATH integer LEQUIV, LPATH
...@@ -576,7 +576,7 @@ C..##ENDIF ...@@ -576,7 +576,7 @@ C..##ENDIF
& PIXX = 28, PIXY = 29, PIXZ = 30, PIYX = 31, & PIXX = 28, PIXY = 29, PIXZ = 30, PIYX = 31,
& PIYY = 32, PIYZ = 33, PIZX = 34, PIZY = 35, & PIYY = 32, PIYZ = 33, PIZX = 34, PIZY = 35,
& PIZZ = 36) & PIZZ = 36)
CHARACTER*4 CEPROP, CETERM, CEPRSS CHARACTER(4) CEPROP, CETERM, CEPRSS
COMMON /ANER/ CEPROP(LENENP), CETERM(LENENT), CEPRSS(LENENV) COMMON /ANER/ CEPROP(LENENP), CETERM(LENENT), CEPRSS(LENENV)
LOGICAL QEPROP, QETERM, QEPRSS LOGICAL QEPROP, QETERM, QEPRSS
COMMON /QENER/ QEPROP(LENENP), QETERM(LENENT), QEPRSS(LENENV) COMMON /QENER/ QEPROP(LENENP), QETERM(LENENT), QEPRSS(LENENV)
...@@ -653,7 +653,7 @@ C:::##INCLUDE '~/charmm_fcm/ctitla.fcm' ...@@ -653,7 +653,7 @@ C:::##INCLUDE '~/charmm_fcm/ctitla.fcm'
INTEGER MAXTIT INTEGER MAXTIT
PARAMETER (MAXTIT=32) PARAMETER (MAXTIT=32)
INTEGER NTITLA,NTITLB INTEGER NTITLA,NTITLB
CHARACTER*80 TITLEA,TITLEB CHARACTER(80) TITLEA,TITLEB
COMMON /NTITLA/ NTITLA,NTITLB COMMON /NTITLA/ NTITLA,NTITLB
COMMON /CTITLA/ TITLEA(MAXTIT),TITLEB(MAXTIT) COMMON /CTITLA/ TITLEA(MAXTIT),TITLEB(MAXTIT)
C..##IF SAVEFCM C..##IF SAVEFCM
......
c { dg-do compile } c { dg-do compile }
c { dg-options "-std=legacy" }
c
c SEGVs in loop.c with -O2. c SEGVs in loop.c with -O2.
character*80 function nxtlin(lun,ierr,itok) character*80 function nxtlin(lun,ierr,itok)
......
c { dg-do run } c { dg-do run }
c { dg-options "-std=legacy" }
c
c Produced a link error through not eliminating the unused statement c Produced a link error through not eliminating the unused statement
c function after 1998-05-15 change to gcc/toplev.c. It's in c function after 1998-05-15 change to gcc/toplev.c. It's in
c `execute' since it needs to link. c `execute' since it needs to link.
......
c { dg-do compile } c { dg-do compile }
c { dg-options "-std=legacy" }
c
CCC Abort fixed by: CCC Abort fixed by:
CCC1998-04-21 Jim Wilson <wilson@cygnus.com> CCC1998-04-21 Jim Wilson <wilson@cygnus.com>
CCC CCC
......
c { dg-do run } c { dg-do run }
c { dg-options "-std=legacy" }
c
! Some versions of cpp will delete "//'World' as a C++ comment. ! Some versions of cpp will delete "//'World' as a C++ comment.
character*40 title character*40 title
title = 'Hello '//'World' title = 'Hello '//'World'
......
! { dg-do run } c { dg-do run }
C The preprocessor must not mangle Hollerith constants C The preprocessor must not mangle Hollerith constants
C which contain apostrophes. C which contain apostrophes.
integer i integer i
character*4 j character(4) j
data i /4hbla'/ data i /4hbla'/
write (j, '(4a)') i write (j, '(4a)') i
if (j .ne. "bla'") call abort if (j .ne. "bla'") call abort
......
...@@ -4,6 +4,8 @@ C ...@@ -4,6 +4,8 @@ C
C Origin: David Billinghurst <David.Billinghurst@riotinto.com> C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
C C
C { dg-do run } C { dg-do run }
C { dg-options "-std=legacy" }
C
integer i,j integer i,j
character*10 buf character*10 buf
......
...@@ -4,6 +4,8 @@ C ...@@ -4,6 +4,8 @@ C
C Origin: David Billinghurst <David.Billinghurst@riotinto.com> C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
C C
C { dg-do run } C { dg-do run }
C { dg-options "-std=legacy" }
C
integer i,j integer i,j
real a,b,c,d,e real a,b,c,d,e
character*32 in character*32 in
......
c { dg-do run } c { dg-do run }
c { dg-options "-std=legacy" }
c
program short program short
parameter ( N=2 ) parameter ( N=2 )
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! Testing g77 intrinsics as subroutines ! Testing g77 intrinsics as subroutines
integer(kind=8) i8 integer(kind=8) i8
integer i4 integer i4
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! Testing g77 intrinsics as subroutines ! Testing g77 intrinsics as subroutines
integer(kind=8) i8, j8 integer(kind=8) i8, j8
integer i4, j4 integer i4, j4
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! This program tests the patch for PR25964. This is a ! This program tests the patch for PR25964. This is a
! regression that would not allow a common block and a statement ! regression that would not allow a common block and a statement
! to share the same name. ! to share the same name.
...@@ -7,4 +9,5 @@ ...@@ -7,4 +9,5 @@
common /foo/ a, b, c common /foo/ a, b, c
foo (x) = x + 1.0 foo (x) = x + 1.0
print *, foo (0.0) print *, foo (0.0)
end end
\ No newline at end of file
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
implicit none implicit none
complex(kind=8) x(2) complex(kind=8) x(2)
complex a(2,2) complex a(2,2)
character*4 z character(4) z
character z1(4) character z1(4)
character*4 z2(2,2) character(4) z2(2,2)
character*80 line character(80) line
integer i integer i
integer j integer j
real r real r
character*8 c character(8) c
data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
data a /8H(i3),abc, 0, 4H(i4), 8H (i9)/ data a /8H(i3),abc, 0, 4H(i4), 8H (i9)/
...@@ -53,7 +53,7 @@ end ...@@ -53,7 +53,7 @@ end
subroutine test (h) subroutine test (h)
integer(kind=8) h integer(kind=8) h
character*80 line character(80) line
write (line, '(8a)') h write (line, '(8a)') h
if (line .ne. ' hello') call abort if (line .ne. ' hello') call abort
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 21260 ! PR 21260
! We wrongly interpreted the '!' as the beginning of a comment. ! We wrongly interpreted the '!' as the beginning of a comment.
! Also verifies the functioning of hollerith formatting. ! Also verifies the functioning of hollerith formatting.
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
implicit none implicit none
complex(kind=8) x(2) complex(kind=8) x(2)
complex a(2,2) complex a(2,2)
character*4 z character(4) z
character z1(4) character z1(4)
character*4 z2(2,2) character(4) z2(2,2)
character*80 line character(80) line
integer i integer i
logical l logical l
real r real r
character*8 c character(8) c
data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
data a /8H(i3),abc, 0, 4H(i4), 8H (i9)/ data a /8H(i3),abc, 0, 4H(i4), 8H (i9)/
...@@ -54,7 +54,7 @@ end ...@@ -54,7 +54,7 @@ end
subroutine test (h) subroutine test (h)
integer(kind=8) h integer(kind=8) h
character*80 line character(80) line
write (line, '(8a)') h write (line, '(8a)') h
if (line .ne. ' hello') call abort if (line .ne. ' hello') call abort
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! PR20879 ! PR20879
! Check that we reject expressions longer than one character for the ! Check that we reject expressions longer than one character for the
! ICHAR and IACHAR intrinsics. ! ICHAR and IACHAR intrinsics.
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! PR 24643 ! PR 24643
! substring references on implicitly typed CHARACTER variables didn't work ! substring references on implicitly typed CHARACTER variables didn't work
PROGRAM P PROGRAM P
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
!
! Tests patch for PR29373, in which the implicit character ! Tests patch for PR29373, in which the implicit character
! statement messes up the function declaration because the ! statement messes up the function declaration because the
! requisite functions in decl.c were told nothing about ! requisite functions in decl.c were told nothing about
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! check to see that you cannot open a direct access file ! check to see that you cannot open a direct access file
! for sequential i/o. ! for sequential i/o.
! derived from NIST test fm910.for ! derived from NIST test fm910.for
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR34795 inquire statement , direct= specifier incorrectly returns YES ! PR34795 inquire statement , direct= specifier incorrectly returns YES
! Test case from PR, modified by Jerry DeLisle <jvdelisle@gcc.gnu.org ! Test case from PR, modified by Jerry DeLisle <jvdelisle@gcc.gnu.org
program testinquire program testinquire
......
! { dg-do run { target fd_truncate } } ! { dg-do run { target fd_truncate } }
! { dg-options "-std=legacy" }
!
! pr19314 inquire(..position=..) segfaults ! pr19314 inquire(..position=..) segfaults
! test by Thomas.Koenig@online.de ! test by Thomas.Koenig@online.de
! bdavis9659@comcast.net ! bdavis9659@comcast.net
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
!pr19313 - inquire(..pad=..) !pr19313 - inquire(..pad=..)
implicit none implicit none
! logical debug ! logical debug
......
...@@ -29,7 +29,7 @@ end module global ...@@ -29,7 +29,7 @@ end module global
use global use global
integer :: a,b, c(20) integer :: a,b, c(20)
integer(8) :: ierr integer(8) :: ierr
character*80 :: buffer(3) character(80) :: buffer(3)
! Appending to a USE associated namelist is an extension. ! Appending to a USE associated namelist is an extension.
......
...@@ -25,7 +25,7 @@ end module global ...@@ -25,7 +25,7 @@ end module global
use global use global
integer :: a,b, c(20) integer :: a,b, c(20)
integer(8) :: ierr integer(8) :: ierr
character*80 :: buffer(3) character(80) :: buffer(3)
! Appending to a USE associated namelist is an extension. ! Appending to a USE associated namelist is an extension.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR16805 ! PR16805
! Test list directed reads from character substrings ! Test list directed reads from character substrings
! The IO library was reporting an error rather the end-of-record when it ! The IO library was reporting an error rather the end-of-record when it
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! Series of routines for testing a loc() implementation ! Series of routines for testing a loc() implementation
program test program test
common /errors/errors(12) common /errors/errors(12)
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR middle-end/19543 ! PR middle-end/19543
program logical_1 program logical_1
implicit none implicit none
......
# 1 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.f" # 1 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.f"
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
subroutine foo subroutine foo
character*10 cpnam character*10 cpnam
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 15327 ! PR 15327
! The merge intrinsic didn't work for strings ! The merge intrinsic didn't work for strings
character*2 :: c(2) character*2 :: c(2)
......
c{ dg-do run { target fd_truncate } } c{ dg-do run { target fd_truncate } }
c{ dg-options "-std=legacy" }
c
c This program repeats many of the same tests as test_nml_1 but for integer c This program repeats many of the same tests as test_nml_1 but for integer
c instead of real. It also tests repeat nulls, comma delimited character read, c instead of real. It also tests repeat nulls, comma delimited character read,
c a triplet qualifier, a range with an assumed start, a quote delimited string, c a triplet qualifier, a range with an assumed start, a quote delimited string,
......
!{ dg-do run } !{ dg-do run }
!{ dg-options "-std=legacy" }
!
! Tests various combinations of intrinsic types, derived types, arrays, ! Tests various combinations of intrinsic types, derived types, arrays,
! dummy arguments and common to check nml_get_addr_expr in trans-io.c. ! dummy arguments and common to check nml_get_addr_expr in trans-io.c.
! See comments below for selection. ! See comments below for selection.
......
!{ dg-do run } !{ dg-do run }
!{ dg-options "-std=legacy" }
!
! Tests character delimiters for namelist write ! Tests character delimiters for namelist write
! provided by Paul Thomas - pault@gcc.gnu.org ! provided by Paul Thomas - pault@gcc.gnu.org
......
!{ dg-do run } !{ dg-do run }
!{ dg-options "-std=legacy" }
!
! Test namelist error trapping. ! Test namelist error trapping.
! provided by Paul Thomas - pault@gcc.gnu.org ! provided by Paul Thomas - pault@gcc.gnu.org
......
!{ dg-do run { target fd_truncate } } !{ dg-do run { target fd_truncate } }
!{ dg-options "-std=legacy" }
!
! Tests filling arrays from a namelist read when object list is not complete. ! Tests filling arrays from a namelist read when object list is not complete.
! Developed from a test case provided by Christoph Jacob. ! Developed from a test case provided by Christoph Jacob.
! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>. ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
......
!{ dg-do run { target fd_truncate } } !{ dg-do run { target fd_truncate } }
!{ dg-options "-std=legacy" }
!
! Tests filling arrays from a namelist read when object list is not complete. ! Tests filling arrays from a namelist read when object list is not complete.
! This is the same as namelist_21.f90 except using spaces as seperators instead ! This is the same as namelist_21.f90 except using spaces as seperators instead
! of commas. Developed from a test case provided by Christoph Jacob. ! of commas. Developed from a test case provided by Christoph Jacob.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR33039 Read NAMELIST: reads wrong namelist name ! PR33039 Read NAMELIST: reads wrong namelist name
! Test case from PR modified by Jerry DeLisle <jvdelisle@gcc.gnu.org> ! Test case from PR modified by Jerry DeLisle <jvdelisle@gcc.gnu.org>
PROGRAM namelist PROGRAM namelist
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR37707 Namelist read of array of derived type incorrect. ! PR37707 Namelist read of array of derived type incorrect.
type s type s
integer m integer m
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR37707 Namelist read of array of derived type incorrect ! PR37707 Namelist read of array of derived type incorrect
! Test case from PR, prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> ! Test case from PR, prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
TYPE geometry TYPE geometry
......
! { dg-do compile }
! { dg-options "-std=legacy" }
!
! pr24584, segfault on namelist reading an empty string ! pr24584, segfault on namelist reading an empty string
! Contributed by Jerry DeLisle <jvdelisle@verizon.net> ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>
implicit none implicit none
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
! Contributed by Paul Thomas pault@gcc.gnu.org ! Contributed by Paul Thomas pault@gcc.gnu.org
! !
module global module global
character*4 :: aa character(4) :: aa
integer :: ii integer :: ii
real :: rr real :: rr
namelist /nml1/ aa, ii, rr namelist /nml1/ aa, ii, rr
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! This tests the fix for PR22010, where namelists were not being written to ! This tests the fix for PR22010, where namelists were not being written to
! and read back from modules. It checks that namelists from modules that are ! and read back from modules. It checks that namelists from modules that are
! selected by an ONLY declaration work correctly, even when the variables in ! selected by an ONLY declaration work correctly, even when the variables in
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
! !
! Test for the fix to PR24409 - the name clash between the module ! Test for the fix to PR24409 - the name clash between the module
! name and the interface formal argument would cause an ICE. ! name and the interface formal argument would cause an ICE.
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-std=legacy" }
! !
! Test for supplementary fix to PR24409 - the name clash between the module ! Test for supplementary fix to PR24409 - the name clash between the module
! variable and the interface formal argument would cause an ICE. ! variable and the interface formal argument would cause an ICE.
......
! { dg-do run } ! { dg-do run }
! { dg-options "-std=legacy" }
!
! PR 20163, first half: Trailing blanks on an option to ! PR 20163, first half: Trailing blanks on an option to
! open used to cause an error ! open used to cause an error
CHARACTER*8 ST CHARACTER*8 ST
......
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