summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/fmt_l.f90
blob: 9dc4f57047322c1766930088383b6fcabf5f739a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
! { 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 "At line 14 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 15 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 19 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 20 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 24 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 25 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 29 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 30 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 34 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 35 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 39 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 40 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 44 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 45 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 49 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }
! { dg-output "At line 50 of file.*" }
! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" }