| 1 |
! { dg-do compile } |
| 2 |
! { dg-require-weak "" } |
| 3 |
|
| 4 |
! 1. |
| 5 |
program foo1 ! { dg-error "weak declaration of 'foo1' must be public" "" } |
| 6 |
implicit none |
| 7 |
!GCC$ ATTRIBUTES weak :: foo1 |
| 8 |
end program |
| 9 |
|
| 10 |
! 2. |
| 11 |
subroutine foo2 |
| 12 |
implicit none |
| 13 |
contains |
| 14 |
function dar() ! { dg-error "weak declaration of 'dar' must be public" "" } |
| 15 |
integer :: dar |
| 16 |
!GCC$ ATTRIBUTES weak :: dar |
| 17 |
end function |
| 18 |
subroutine bar ! { dg-error "weak declaration of 'bar' must be public" "" } |
| 19 |
!GCC$ ATTRIBUTES weak :: bar |
| 20 |
end subroutine |
| 21 |
end subroutine |
| 22 |
|
| 23 |
! 3. |
| 24 |
subroutine foo3(n) ! { dg-error "has the WEAK attribute but is a dummy argument" "" } |
| 25 |
implicit none |
| 26 |
integer :: n |
| 27 |
!GCC$ ATTRIBUTES weak :: n |
| 28 |
real :: abc ! { dg-error "has the WEAK attribute but is a local variable" "" } |
| 29 |
!GCC$ ATTRIBUTES weak :: abc |
| 30 |
end subroutine |