1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test specification expressions
10 integer function foo()
12 pure
real function realfunc(x
)
15 pure
integer function hasProcArg(p
)
17 procedure(realfunc
) :: p
23 pure
integer function modulefunc1(n
)
27 subroutine test(out
, optional
)
28 !ERROR: Invalid specification expression: reference to impure function 'foo'
31 !ERROR: Invalid specification expression: reference to local entity 'local'
33 !ERROR: The internal function 'internal' may not be referenced in a specification expression
34 type(t(internal(0))) :: x3
35 integer, intent(out
) :: out
36 !ERROR: Invalid specification expression: reference to INTENT(OUT) dummy argument 'out'
38 integer, intent(in
), optional
:: optional
39 !ERROR: Invalid specification expression: reference to OPTIONAL dummy argument 'optional'
40 type(t(optional
)) :: x5
41 !ERROR: Invalid specification expression: reference to function 'hasprocarg' with dummy procedure argument 'p'
42 type(t(hasProcArg())) :: x6
43 !ERROR: Invalid specification expression: coindexed reference
44 type(t(coarray
[1])) :: x7
45 type(t(kind(foo()))) :: x101
! ok
46 type(t(modulefunc1(0))) :: x102
! ok
47 type(t(modulefunc2(0))) :: x103
! ok
49 pure
integer function internal(n
)
54 pure
integer function modulefunc2(n
)