aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2006-02-19 21:31:02 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2006-02-19 21:31:02 +0000
commit8f0d39a86b963ad0d39edb2e7bf633b5790432fc (patch)
tree0f202b9e85194d9bc5ec4b762d158c3dabb04d2c /gcc/testsuite/gfortran.dg
parentf5dc42bbcc9180a661f1447efda575d6362cf9fc (diff)
downloadgcc-8f0d39a86b963ad0d39edb2e7bf633b5790432fc.zip
gcc-8f0d39a86b963ad0d39edb2e7bf633b5790432fc.tar.gz
gcc-8f0d39a86b963ad0d39edb2e7bf633b5790432fc.tar.bz2
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
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_l.f9069
1 files changed, 69 insertions, 0 deletions
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" }