1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test 8.5.10 & 8.5.18 constraints on dummy argument declarations
7 real, allocatable
:: a(:)[:]
9 type, extends(hasCoarray
) :: extendsHasCoarray
14 type, extends(hasCoarray2
) :: extendsHasCoarray2
17 real, allocatable
:: coarray(:)[:]
22 real, allocatable
, intent(out
) :: x(:)
24 subroutine s01b
! C846 - can only be caught at a call via explicit interface
25 !ERROR: ALLOCATABLE coarray 'coarray' may not be associated with INTENT(OUT) dummy argument 'x='
26 !ERROR: ALLOCATABLE dummy argument 'x=' has corank 0 but actual argument has corank 1
30 subroutine s02(x
) ! C846
31 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
32 type(hasCoarray
), intent(out
) :: x
35 subroutine s03(x
) ! C846
36 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
37 type(extendsHasCoarray
), intent(out
) :: x
40 subroutine s04(x
) ! C846
41 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
42 type(hasCoarray2
), intent(out
) :: x
45 subroutine s05(x
) ! C846
46 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
47 type(extendsHasCoarray2
), intent(out
) :: x
52 subroutine s06(x
) ! C847
53 use ISO_FORTRAN_ENV
, only
: lock_type
54 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE
55 type(lock_type
), intent(out
) :: x
58 subroutine s07(x
) ! C847
59 use ISO_FORTRAN_ENV
, only
: event_type
60 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE
61 type(event_type
), intent(out
) :: x