Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / call18.f90
blobfb5895fe69b2e28fcb0270af4e545ebcee2399b3
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Ensure that references to functions that return pointers can serve as
3 ! "variables" in actual arguments. All of these uses are conforming and
4 ! no errors should be reported.
5 module m
6 integer, target :: x = 1
7 contains
8 function get() result(p)
9 integer, pointer :: p
10 p => x
11 end function get
12 subroutine increment(n)
13 integer, intent(inout) :: n
14 n = n + 1
15 end subroutine increment
16 end module m
18 use m
19 integer, pointer :: q
20 get() = 2
21 call increment(get())
22 q => get()
23 read(*) get()
24 open(file='file',newunit=get())
25 allocate(q,stat=get())
26 end