Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / call34.f90
blob4f939f2425d1e43f82e728d74fda1d555cd98270
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
2 module m
3 contains
4 subroutine foo(a)
5 real, intent(in), target :: a(:)
6 end subroutine
7 end module
9 program test
10 use m
11 real, target :: a(1)
12 real :: b(1)
13 call foo(a) ! ok
14 !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call must not be used afterwards, as 'b' is not a target
15 call foo(b)
16 !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of '(a)' afterwards
17 call foo((a))
18 !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of 'a([INTEGER(8)::1_8])' afterwards
19 call foo(a([1]))
20 !ERROR: Scalar actual argument may not be associated with assumed-shape dummy argument 'a='
21 call foo(a(1))
22 end