1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2 ! Tests valid and invalid usage of forward references to procedures
3 ! in specification expressions.
11 !ERROR: Automatic data object 'a' may not appear in a module
13 !ERROR: Automatic data object 'b' may not appear in a module
15 !ERROR: Automatic data object 'c' may not appear in COMMON block /blk/
17 !ERROR: Automatic data object 'd' may not appear in COMMON block //
23 integer :: iarr(if1(n
))
25 pure
integer function if1(n
)
26 integer, intent(in
) :: n
30 integer :: iarr(ifn3(n
)) ! should resolve to if3
32 pure
integer function if2(n
)
33 integer, intent(in
) :: n
36 pure
integer function if3(n
)
37 integer, intent(in
) :: n
43 !ERROR: The internal function 'if1' may not be referenced in a specification expression
47 !ERROR: The internal function 'if2' may not be referenced in a specification expression
48 integer :: iarr(if2(n
))
50 pure
integer function if1(n
)
51 integer, intent(in
) :: n
54 pure
integer function if2(n
)
55 integer, intent(in
) :: n
63 !PORTABILITY: specification expression refers to local object 'n' (initialized and saved)
64 !ERROR: Automatic data object 'a' may not appear in a BLOCK DATA subprogram
70 !PORTABILITY: Automatic data object 'a' should not appear in the specification part of a main program