From 8f0d39a86b963ad0d39edb2e7bf633b5790432fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Coudert?= Date: Sun, 19 Feb 2006 21:31:02 +0000 Subject: re PR libfortran/21303 (L edit descriptor without a width) PR libfortran/21303 * gfortran.h (notification): New enumeration. (gfc_notification_std): Prototype for the new function. * error.c (gfc_notification_std): New function. * io.c (check_format): Handle the case of a L format descriptor without a width. * runtime/error.c (notification_std): New function. * libgfortran.h (notification): New enumeration. * io/io.h (notification_std): Prototype for the new function. * io/format.c (parse_format_list): Handle the case of a L format descriptor without a width. * gcc/testsuite/gfortran.dg/fmt_l.f90: New test. From-SVN: r111281 --- gcc/testsuite/gfortran.dg/fmt_l.f90 | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/fmt_l.f90 (limited to 'gcc/testsuite/gfortran.dg') diff --git a/gcc/testsuite/gfortran.dg/fmt_l.f90 b/gcc/testsuite/gfortran.dg/fmt_l.f90 new file mode 100644 index 0000000..e03f63d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/fmt_l.f90 @@ -0,0 +1,69 @@ +! { dg-do run } +! { dg-options "-std=gnu -pedantic -ffree-line-length-none" } +! Test the GNU extension of a L format descriptor without width +! PR libfortran/21303 +program test_l + logical(kind=1) :: l1 + logical(kind=2) :: l2 + logical(kind=4) :: l4 + logical(kind=8) :: l8 + + character(len=20) :: str + + l1 = .true. + write (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l1 .neqv. .true.) call abort + + l2 = .true. + write (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l2 .neqv. .true.) call abort + + l4 = .true. + write (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l4 .neqv. .true.) call abort + + l8 = .true. + write (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l8 .neqv. .true.) call abort + + l1 = .false. + write (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l1 .neqv. .false.) call abort + + l2 = .false. + write (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l2 .neqv. .false.) call abort + + l4 = .false. + write (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l4 .neqv. .false.) call abort + + l8 = .false. + write (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" } + read (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" } + if (l8 .neqv. .false.) call abort + +end program test_l +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format\n" } -- cgit v1.1