1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests attempts at forward references to local names in a FUNCTION prefix
4 ! This case is not an error, but will elicit bogus errors if the
5 ! result type of the function is badly resolved.
12 type(t1
) function foo(n
)
13 integer, intent(in
) :: n
34 integer, parameter :: k
= kind(1.e0
)
36 real(kind
=k
) function foo(n
)
37 integer, parameter :: k
= kind(1.d0
)
38 integer, intent(in
) :: n
45 !If we got the type of foo right, this declaration will fail
46 !due to an attempted division by zero.
47 !ERROR: Must be a constant value
48 integer, parameter :: test
= 1 / (kind(foo(1)) - kind(1.e0
))
52 integer, parameter :: k
= kind(1.e0
)
54 real(kind
=kind(x
)) function foo(x
)
55 !ERROR: The type of 'x' has already been implicitly declared
56 real(kind
=kind(1.0d0)) x
63 !ERROR: Must be a constant value
64 real(n
) function foo(x
)
65 integer, parameter :: n
= kind(foo
)
66 real(n
), intent(in
) :: x