Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / procinterface02.f90
blob3f73e2e75f8db501a247161b6298d1eb37391b89
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 subroutine foo(A, B, P)
3 interface
4 real elemental function foo_elemental(x)
5 real, intent(in) :: x
6 end function
7 pure real function foo_pure(x)
8 real, intent(in) :: x
9 end function
10 real function foo_nonelemental(x)
11 real, intent(in) :: x
12 end function
13 end interface
14 real :: A(:), B(:)
15 procedure(sqrt), pointer :: P
16 !ERROR: Rank of dummy argument is 0, but actual argument has rank 1
17 A = P(B)
18 !ERROR: Procedure pointer 'p' associated with incompatible procedure designator 'foo_elemental': incompatible procedure attributes: Elemental
19 P => foo_elemental
20 P => foo_pure ! ok
21 !ERROR: PURE procedure pointer 'p' may not be associated with non-PURE procedure designator 'foo_nonelemental'
22 P => foo_nonelemental
23 end subroutine