| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fdec-static" } |
| 3 |
! |
| 4 |
! Check for conflicts between STATIC/AUTOMATIC and other attributes. |
| 5 |
! |
| 6 |
|
| 7 |
function s(a, b, x, y) result(z) |
| 8 |
implicit none |
| 9 |
integer, automatic, intent(IN) :: a ! { dg-error "DUMMY attribute conflicts" } |
| 10 |
integer, static, intent(IN) :: b ! { dg-error "DUMMY attribute conflicts" } |
| 11 |
integer, intent(OUT) :: x, y |
| 12 |
automatic :: x ! { dg-error "DUMMY attribute conflicts" } |
| 13 |
static :: y ! { dg-error "DUMMY attribute conflicts" } |
| 14 |
|
| 15 |
automatic ! { dg-error "Expected entity-list in AUTOMATIC statement" } |
| 16 |
automatic :: ! { dg-error "Expected entity-list in AUTOMATIC statement" } |
| 17 |
static ! { dg-error "Expected entity-list in STATIC statement" } |
| 18 |
static :: ! { dg-error "Expected entity-list in STATIC statement" } |
| 19 |
|
| 20 |
integer, automatic :: auto1, auto2 |
| 21 |
integer, static :: static1, static2 |
| 22 |
integer :: auto3, static3 |
| 23 |
automatic :: auto3 |
| 24 |
static :: static3 |
| 25 |
|
| 26 |
common /c1/ auto1, auto2 ! { dg-error "COMMON attribute conflicts" } |
| 27 |
common /c2/ static1, static2 ! { dg-error "COMMON attribute conflicts" } |
| 28 |
common /c3/ auto3, static3 ! { dg-error "COMMON attribute conflicts" } |
| 29 |
|
| 30 |
integer, static :: z ! { dg-error "RESULT attribute conflicts" } |
| 31 |
integer, automatic :: z ! { dg-error "RESULT attribute conflicts" } |
| 32 |
static :: z ! { dg-error "RESULT attribute conflicts" } |
| 33 |
automatic :: z ! { dg-error "RESULT attribute conflicts" } |
| 34 |
|
| 35 |
integer, static, automatic :: o ! { dg-error "AUTOMATIC attribute conflicts" } |
| 36 |
|
| 37 |
integer :: a, b, z ! fall-back decls so we don't get "no implicit type" |
| 38 |
end |