PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr71523_2.f90
blobb1730f2699abe1773fcf3d812603f5c0fd4494f3
1 ! PR Fortran/71523
3 ! { dg-do run }
4 ! { dg-options "-finit-integer=12345 -fautomatic -fmax-stack-var-size=8" }
6 ! Make sure that variables larger than max-stack-var-size become
7 ! static and are given the correct _static_ initializer.
10 function set(idx, val)
11 implicit none
12 integer, intent(in) :: idx, val
13 integer set
14 integer arr(100)
16 set = arr(idx)
17 arr(idx) = val
18 return
19 end function
21 integer set, val
23 val = set(1, 5)
24 if (val .ne. 12345) then
25 STOP 1
26 endif
28 val = set(1, 10)
29 if (val .ne. 5) then
30 STOP 2
31 endif
33 val = set(1, 100)
34 if (val .ne. 10) then
35 STOP 3
36 endif
38 end