5 ! Contributed by Mikael Morin
7 ! Check whether passing NULL() to an elemental procedure works,
8 ! where NULL() denotes an absent optional argument.
16 a
= foo((/ 1, 1 /), null())
18 if (any(a
/= 2)) call abort
21 a
= bar((/ 1, 1 /), null())
23 if (any(a
/= 2)) call abort
28 if (b
/= 2) call abort
34 integer, optional
:: b(:)
35 integer :: foo(size(a
))
37 if (present(b
)) call abort
42 elemental
function bar(a
, b
)
43 integer, intent(in
) :: a
44 integer, intent(in
), optional
:: b
49 if (present(b
)) bar
= 1