2 ! { dg-options "-fdec" }
4 ! Run-time tests for values of DEC I/O parameters (doesn't test functionality).
7 subroutine check_cc (fd
, cc
)
9 character(*), intent(in
) :: cc
10 integer, intent(in
) :: fd
11 character(20) :: cc_inq
12 inquire(unit
=fd
, carriagecontrol
=cc_inq
)
13 if (cc_inq
.ne
. cc
) then
14 print *, '(', fd
, ') cc expected ', cc
, ' was ', cc_inq
19 subroutine check_share (fd
, share
)
21 character(*), intent(in
) :: share
22 integer, intent(in
) :: fd
23 character(20) :: share_inq
24 inquire(unit
=fd
, share
=share_inq
)
25 if (share_inq
.ne
. share
) then
26 print *, '(', fd
, ') share expected ', share
, ' was ', share_inq
31 subroutine check_action (fd
, acc
)
33 character(*), intent(in
) :: acc
34 integer, intent(in
) :: fd
36 inquire(unit
=fd
, action
=acc_inq
)
37 if (acc_inq
.ne
. acc
) then
38 print *, '(', fd
, ') access expected ', acc
, ' was ', acc_inq
45 integer, parameter :: fd
=3
46 character(*), parameter :: fname
= 'dec_io_1.txt'
50 open(unit
=fd
, file
=fname
, action
='WRITE')
51 call check_cc(fd
, 'LIST')
52 call check_share(fd
, 'NODENY')
58 open (unit
=fd
, file
=fname
, readonly)
59 call check_action(fd
, 'READ')
62 !!!! SHARED / SHARE='DENYNONE'
64 open (unit
=fd
, file
=fname
, action
='read', shared)
65 call check_share(fd
, 'DENYNONE')
68 open (unit
=fd
, file
=fname
, action
='read', share
='DENYNONE')
69 call check_share(fd
, 'DENYNONE')
72 !!!! NOSHARED / SHARE='DENYRW'
74 open (unit
=fd
, file
=fname
, action
='write', noshared
)
75 call check_share(fd
, 'DENYRW')
78 open (unit
=fd
, file
=fname
, action
='write', share
='DENYRW')
79 call check_share(fd
, 'DENYRW')
84 open(unit
=fd
, file
=fname
, action
='WRITE', carriagecontrol
='FORTRAN')
85 call check_cc(fd
, 'FORTRAN')
90 open(unit
=fd
, file
=fname
, action
='WRITE', carriagecontrol
='LIST')
91 call check_cc(fd
, 'LIST')
96 open(unit
=fd
, file
=fname
, action
='WRITE', carriagecontrol
='NONE')
97 call check_cc(fd
, 'NONE')
98 close(unit
=fd
, status
='delete') ! cleanup temp file