gcc/testsuite/gfortran.dg/volatile9.f90
raw| 1 | ! Check for valid VOLATILE uses |
| 2 | ! |
| 3 | ! Contributed by Steven Correll. |
| 4 | ! |
| 5 | ! PR fortran/30520 |
| 6 | |
| 7 | ! { dg-do compile } |
| 8 | |
| 9 | function f() result(fr) |
| 10 | integer, volatile :: fr |
| 11 | fr = 5 |
| 12 | end function f |
| 13 | |
| 14 | module mod13 |
| 15 | implicit none |
| 16 | integer :: v13 |
| 17 | end module mod13 |
| 18 | |
| 19 | module mod13a |
| 20 | use mod13 |
| 21 | implicit none |
| 22 | volatile :: v13 |
| 23 | real :: v14 |
| 24 | contains |
| 25 | subroutine s13() |
| 26 | volatile :: v13 |
| 27 | volatile :: v14 |
| 28 | end subroutine s13 |
| 29 | end module mod13a |
| 30 | |
| 31 | module mod13b |
| 32 | use mod13a |
| 33 | implicit none |
| 34 | volatile :: v13 |
| 35 | end module mod13b |
| 36 | |
| 37 | |
| 38 | subroutine s14() |
| 39 | use mod13a |
| 40 | implicit none |
| 41 | volatile :: v13 |
| 42 | end subroutine s14 |