4 ! Check proper detection of presence of optional array dummy arguments
5 ! for zero-sized actual array arguments or array constructors:
10 character(0), parameter :: c0(0) = ""
11 character(0), parameter :: c1(1) = ""
12 character(1), parameter :: d0(0) = ""
13 character(1), parameter :: d1(1) = ""
16 character(:), allocatable
:: cc(:)
17 integer :: k
= 0, l
= 0 ! Test/failure counter
19 allocate (character(0) :: cc(0))
24 print *, "Total tests:", k
, " failed:", l
27 print *, "Variables as actual argument"
35 print *, "Array section as actual argument"
45 print *, "Explicit temporary as actual argument"
54 call i ((c1(1:0)(1:0)))
56 call i ((w1(1:0)(1:0)))
58 call i ((cc(1:0)(1:0)))
62 print *, "Array constructor as actual argument"
75 call i ([c1(1:0)(1:0)])
77 call i ([w1(1:0)(1:0)])
79 call i ([cc(1:0)(1:0)])
83 print *, "Array constructor with type-spec as actual argument"
84 call i ([character(0) :: ])
85 call i ([character(0) :: ""])
86 call i ([character(0) :: c0
])
87 call i ([character(0) :: c1
])
88 call i ([character(0) :: d0
])
89 call i ([character(0) :: d1
])
90 call i ([character(0) :: w0
])
91 call i ([character(0) :: w1
])
92 call i ([character(0) :: cc
])
93 call i ([character(0) :: c0
,c0
])
94 call i ([character(0) :: c1
,c1
])
95 call i ([character(0) :: d0
,d0
])
96 call i ([character(0) :: cc
,cc
])
97 call i ([character(0) :: c1(1:0)])
98 call i ([character(0) :: c1(1:0)(1:0)])
99 call i ([character(0) :: w1(1:0)])
100 call i ([character(0) :: w1(1:0)(1:0)])
101 call i ([character(0) :: cc(1:0)])
102 call i ([character(0) :: cc(1:0)(1:0)])
106 character(*), optional
, intent(in
) :: arg(:)
110 print *, 'test', k
, merge (" ok", "FAIL", t
)
111 if (.not
. t
) l
= l
+ 1