c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / fmt_l.f90
blob5ca313fa387c625dc0a21ba7944101f47fd91128
1 ! { 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
11 character(len=20) :: str
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.) STOP 1
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.) STOP 2
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.) STOP 3
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.) STOP 4
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.) STOP 5
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.) STOP 6
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.) STOP 7
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.) STOP 8
53 end program test_l
54 ! { dg-output "At line 14 of file.*" }
55 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
56 ! { dg-output "At line 15 of file.*" }
57 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
58 ! { dg-output "At line 19 of file.*" }
59 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
60 ! { dg-output "At line 20 of file.*" }
61 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
62 ! { dg-output "At line 24 of file.*" }
63 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
64 ! { dg-output "At line 25 of file.*" }
65 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
66 ! { dg-output "At line 29 of file.*" }
67 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
68 ! { dg-output "At line 30 of file.*" }
69 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
70 ! { dg-output "At line 34 of file.*" }
71 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
72 ! { dg-output "At line 35 of file.*" }
73 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
74 ! { dg-output "At line 39 of file.*" }
75 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
76 ! { dg-output "At line 40 of file.*" }
77 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
78 ! { dg-output "At line 44 of file.*" }
79 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
80 ! { dg-output "At line 45 of file.*" }
81 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
82 ! { dg-output "At line 49 of file.*" }
83 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }
84 ! { dg-output "At line 50 of file.*" }
85 ! { dg-output "Fortran runtime warning: Positive width required with L descriptor(\r*\n+)" }