Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / call27.f90
blob965ec401953f43077402370fa4ce70c72e3b45a1
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Catch NULL() actual argument association with allocatable dummy argument
3 program test
4 !ERROR: Null actual argument 'NULL()' may not be associated with allocatable dummy argument 'a='
5 call foo1(null())
6 !ERROR: Null actual argument 'NULL()' may not be associated with allocatable dummy argument 'a='
7 call foo2(null()) ! perhaps permissible later on user request
8 call foo3(null()) ! ok
9 contains
10 subroutine foo1(a)
11 real, allocatable :: a
12 end subroutine
13 subroutine foo2(a)
14 real, allocatable, intent(in) :: a
15 end subroutine
16 subroutine foo3(a)
17 real, allocatable, optional :: a
18 end subroutine
19 end