Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / call28.f90
blob51430853d663ff152f93b7504d1efb2ff5c25215
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 module m1
4 type :: t
5 end type
6 contains
7 pure subroutine s1(x)
8 class(t), intent(in out) :: x
9 call s2(x)
10 call s3(x)
11 end subroutine
12 pure subroutine s2(x)
13 class(t), intent(in out) :: x
14 !ERROR: Left-hand side of assignment may not be polymorphic unless assignment is to an entire allocatable
15 !ERROR: Left-hand side of assignment is not definable
16 !BECAUSE: 'x' is polymorphic in a pure subprogram
17 x = t()
18 end subroutine
19 pure subroutine s3(x)
20 !ERROR: An INTENT(OUT) dummy argument of a pure subroutine may not be polymorphic
21 class(t), intent(out) :: x
22 end subroutine
23 end module