summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/elemental_non_intrinsic_dummy_1.f90
blob: 207d76a4b7b230d562b90e3e6addd6620cd6c28e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do compile }
! Tests the fix for 20871, in which elemental non-intrinsic procedures were
! permitted to be dummy arguments.
!
! Contributed by Joost VandeVondele  <jv244@cam.ac.uk>
!
MODULE TT
CONTAINS
   ELEMENTAL INTEGER FUNCTION two(N)
     INTEGER, INTENT(IN) :: N
     two=2**N
   END FUNCTION
END MODULE
USE TT
 INTEGER, EXTERNAL  :: SUB
 write(6,*) SUB(two)    ! { dg-error "not allowed as an actual argument " }
END
INTEGER FUNCTION SUB(XX)
  INTEGER :: XX
  SUB=XX()
END

! { dg-final { cleanup-modules "TT" } }