aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/module_parameter_array_refs_2.f90
blob: 7324ff6c51e62c3b52f16cc75016ddb7e7aa0cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do compile }
! { dg-options "-O" }
! { dg-final { scan-assembler-not "i_am_optimized_away" } }
!
! PR fortran/50960
!
! PARAMETER arrays and derived types exists as static variables.
! Check that the their read-only nature is taken into account
! when optimizations are done.
!

module m
  integer, parameter :: PARA(*) = [1,2,3,4,5,6,7,8,9,10]
end module m

subroutine test()
use m
integer :: i
i = 1
if (para(i) /= 1) call i_am_optimized_away()
end