| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/92996 |
| 4 |
! |
| 5 |
! Contributed by G. Steinmetz |
| 6 |
! |
| 7 |
|
| 8 |
module m |
| 9 |
integer, parameter :: d(2) = [0,0] |
| 10 |
end module m |
| 11 |
|
| 12 |
subroutine one |
| 13 |
use m |
| 14 |
print size([1,2],dim=d(1)) ! { dg-error "'dim' argument of 'size' intrinsic at .1. is not a valid dimension index" } |
| 15 |
end |
| 16 |
|
| 17 |
subroutine two |
| 18 |
complex, parameter :: x = 1 |
| 19 |
|
| 20 |
stop x ! { dg-error "STOP code at .1. must be either INTEGER or CHARACTER type" } |
| 21 |
end |
| 22 |
|
| 23 |
program p |
| 24 |
integer, parameter :: a(2) = [1, 2] |
| 25 |
stop a(1) ! OK |
| 26 |
stop a ! { dg-error "STOP code at .1. must be scalar" } |
| 27 |
stop a(1,1) ! { dg-error "Rank mismatch in array reference at .1. .2/1." } |
| 28 |
end |