arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR115360]
[official-gcc.git] / gcc / testsuite / gfortran.dg / io_constraints_7.f03
blob6b686f38d2b6a46a5ea08a2a55f243f5cc66c331
1 ! { dg-do compile }
3 ! PR fortran/45776
4 ! Variable definition context checks related to IO.
6 ! Contributed by Daniel Kraft, d@domob.eu.
8 module m
9   implicit none
10   integer, protected :: a
11   character(len=128), protected :: msg
12 end module m
14 program main
15   use :: m
16   integer :: x
17   logical :: bool
19   write (*, iostat=a) 42 ! { dg-error "variable definition context" }
20   write (*, iomsg=msg) 42 ! { dg-error "variable definition context" }
21   read (*, '(I2)', advance='no', size=a) x ! { dg-error "variable definition context" }
23   ! These are ok.
24   inquire (unit=a)
25   inquire (file=msg, id=a, pending=bool)
26   inquire (file=msg)
28   ! These not, but list is not extensive.
29   inquire (unit=1, number=a) ! { dg-error "variable definition context" }
30   inquire (unit=1, encoding=msg) ! { dg-error "variable definition context" }
31   inquire (unit=1, formatted=msg) ! { dg-error "variable definition context" }
33   open (newunit=a, file="foo") ! { dg-error "variable definition context" }
34   close (unit=a)
35 end program main