aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/elemental_args_check_3.f90
blob: 8d63874579477023862e94fae3e3ad6cc0f6d790 (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 }

! Check for constraints restricting arguments of ELEMENTAL procedures.

! Contributed by Daniel Kraft, d@domob.eu.

PROGRAM main
  IMPLICIT NONE

CONTAINS

  IMPURE ELEMENTAL SUBROUTINE foobar &
    (a, & ! { dg-error "must be scalar" }
     b, & ! { dg-error "POINTER attribute" }
     c, & ! { dg-error "ALLOCATABLE attribute" }
     d) ! { dg-error "must have its INTENT specified or have the VALUE attribute" }
    INTEGER, INTENT(IN) :: a(:)
    INTEGER, POINTER, INTENT(IN) :: b
    INTEGER, ALLOCATABLE, INTENT(IN) :: c
    INTEGER :: d
  END SUBROUTINE foobar

END PROGRAM main