Debian Codegraph @

gcc/testsuite/gfortran.dg/io_constraints_12.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-std=f2003" }
3 !
4 ! Test our conformance to item 4.9 ("Kind type parameters of integer
5 ! specifiers") of the Fortran 2003 status document at
6 ! ftp://ftp.nag.co.uk/sc22wg5/N1551-N1600/N1579.pdf
7 !
8 ! The non-default integer variables are allowed since Fortran 2003.
9 ! The non-default logical variables are allowed since Fortran 2008.
10
11 integer(kind=8) :: i, j, k, n
12 logical(kind=8) :: l1, l2, l3
13
14 open(10, status="scratch", iostat=i)
15
16 backspace(10, iostat=i)
17 endfile(10, iostat=i)
18 rewind(10, iostat=i)
19
20 read(*, '(I2)', iostat=i) k
21 read(*, '(I2)', advance='no', size=j) k
22
23 inquire(iolength=i) "42"
24 inquire(10, iostat=i)
25 inquire(10, number=j)
26 inquire(10, recl=k)
27 inquire(10, nextrec=n)
28
29 inquire(10, exist=l1) ! { dg-error "Non-default LOGICAL kind" }
30 inquire(10, named=l3) ! { dg-error "Non-default LOGICAL kind" }
31 inquire(10, opened=l2) ! { dg-error "Non-default LOGICAL kind" }
32 inquire(10, pending=l2) ! { dg-error "Non-default LOGICAL kind" }
33
34 close(10, iostat=i)
35
36 end