1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests ELEMENTAL subprogram constraints C15100-15102
4 !ERROR: An ELEMENTAL subroutine may not have an alternate return dummy argument
5 elemental
subroutine altret(*)
8 elemental
subroutine arrarg(a
)
9 !ERROR: A dummy argument of an ELEMENTAL procedure must be scalar
10 real, intent(in
) :: a(1)
13 elemental
subroutine alloarg(a
)
14 !ERROR: A dummy argument of an ELEMENTAL procedure may not be ALLOCATABLE
15 real, intent(in
), allocatable
:: a
18 elemental
subroutine coarg(a
)
19 !ERROR: A dummy argument of an ELEMENTAL procedure may not be a coarray
20 real, intent(in
) :: a
[*]
23 elemental
subroutine ptrarg(a
)
24 !ERROR: A dummy argument of an ELEMENTAL procedure may not be a POINTER
25 real, intent(in
), pointer :: a
28 impure elemental
subroutine barearg(a
)
29 !ERROR: A dummy argument of an ELEMENTAL procedure must have an INTENT() or VALUE attribute
33 elemental
function arrf(n
)
35 !ERROR: The result of an ELEMENTAL function must be scalar
39 elemental
function allof(n
)
41 !ERROR: The result of an ELEMENTAL function may not be ALLOCATABLE
42 real, allocatable
:: allof
45 elemental
function ptrf(n
)
47 !ERROR: The result of an ELEMENTAL function may not be a POINTER