1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests actual/dummy pointer argument shape mismatches
6 real, pointer, intent(in
) :: p
9 real, pointer, intent(in
) :: p(:)
12 real, pointer, intent(in
) :: p(..)
15 real, intent(in
), optional
, pointer :: p(..)
18 real, intent(in
), optional
:: x(..)
21 real, intent(in
), optional
, allocatable
:: a(..)
24 real, pointer :: a0
, a1(:)
25 call s0(null(a0
)) ! ok
26 !ERROR: Rank of dummy argument is 0, but actual argument has rank 1
27 !ERROR: Rank of pointer is 0, but function result has rank 1
29 !ERROR: Rank of dummy argument is 1, but actual argument has rank 0
30 !ERROR: Rank of pointer is 1, but function result has rank 0
32 call s1(null(a1
)) ! ok
33 call sa(null(a0
)) ! ok
34 call sa(null(a1
)) ! ok
35 !ERROR: NULL() without MOLD= must not be associated with an assumed-rank dummy argument that is ALLOCATABLE, POINTER, or non-OPTIONAL
38 !ERROR: NULL() without MOLD= must not be associated with an assumed-rank dummy argument that is ALLOCATABLE, POINTER, or non-OPTIONAL
43 !ERROR: NULL() without MOLD= must not be associated with an assumed-rank dummy argument that is ALLOCATABLE, POINTER, or non-OPTIONAL