summaryrefslogtreecommitdiff
path: root/flang/test/Semantics/call27.f90
blob: 965ec401953f43077402370fa4ce70c72e3b45a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
! RUN: %python %S/test_errors.py %s %flang_fc1
! Catch NULL() actual argument association with allocatable dummy argument
program test
  !ERROR: Null actual argument 'NULL()' may not be associated with allocatable dummy argument 'a='
  call foo1(null())
  !ERROR: Null actual argument 'NULL()' may not be associated with allocatable dummy argument 'a='
  call foo2(null()) ! perhaps permissible later on user request
  call foo3(null()) ! ok
 contains
  subroutine foo1(a)
    real, allocatable :: a
  end subroutine
  subroutine foo2(a)
    real, allocatable, intent(in) :: a
  end subroutine
  subroutine foo3(a)
    real, allocatable, optional :: a
  end subroutine
end