1 |
12 |
jlechner |
! { dg-do run }
|
2 |
|
|
! { dg-options "-std=gnu -pedantic -ffree-line-length-none" }
|
3 |
|
|
! Test the GNU extension of a L format descriptor without width
|
4 |
|
|
! PR libfortran/21303
|
5 |
|
|
program test_l
|
6 |
|
|
logical(kind=1) :: l1
|
7 |
|
|
logical(kind=2) :: l2
|
8 |
|
|
logical(kind=4) :: l4
|
9 |
|
|
logical(kind=8) :: l8
|
10 |
|
|
|
11 |
|
|
character(len=20) :: str
|
12 |
|
|
|
13 |
|
|
l1 = .true.
|
14 |
|
|
write (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
15 |
|
|
read (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
16 |
|
|
if (l1 .neqv. .true.) call abort
|
17 |
|
|
|
18 |
|
|
l2 = .true.
|
19 |
|
|
write (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
20 |
|
|
read (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
21 |
|
|
if (l2 .neqv. .true.) call abort
|
22 |
|
|
|
23 |
|
|
l4 = .true.
|
24 |
|
|
write (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
25 |
|
|
read (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
26 |
|
|
if (l4 .neqv. .true.) call abort
|
27 |
|
|
|
28 |
|
|
l8 = .true.
|
29 |
|
|
write (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
30 |
|
|
read (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
31 |
|
|
if (l8 .neqv. .true.) call abort
|
32 |
|
|
|
33 |
|
|
l1 = .false.
|
34 |
|
|
write (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
35 |
|
|
read (str,"(L)") l1 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
36 |
|
|
if (l1 .neqv. .false.) call abort
|
37 |
|
|
|
38 |
|
|
l2 = .false.
|
39 |
|
|
write (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
40 |
|
|
read (str,"(L)") l2 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
41 |
|
|
if (l2 .neqv. .false.) call abort
|
42 |
|
|
|
43 |
|
|
l4 = .false.
|
44 |
|
|
write (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
45 |
|
|
read (str,"(L)") l4 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
46 |
|
|
if (l4 .neqv. .false.) call abort
|
47 |
|
|
|
48 |
|
|
l8 = .false.
|
49 |
|
|
write (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
50 |
|
|
read (str,"(L)") l8 ! { dg-warning "Extension: Missing positive width after L descriptor" }
|
51 |
|
|
if (l8 .neqv. .false.) call abort
|
52 |
|
|
|
53 |
|
|
end program test_l
|
54 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
55 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
56 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
57 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
58 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
59 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
60 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
61 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
62 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
63 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
64 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
65 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
66 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
67 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
68 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|
69 |
|
|
! { dg-output "Fortran runtime warning: Positive width required in format\n" }
|