[committed][RISC-V][PR target/114139] Verify we have a CONST_INT before extracting...
[official-gcc.git] / gcc / testsuite / gfortran.dg / save_1.f90
blobca757d34cdeeca906e37d3f2752056fb3e665e51
1 ! { dg-do run }
2 ! { dg-options "-O2 -fno-automatic" }
3 subroutine foo (b)
4 logical b
5 integer i, j
6 character*24 s
7 save i
8 if (b) then
9 i = 26
10 j = 131
11 s = 'This is a test string'
12 else
13 if (i .ne. 26 .or. j .ne. 131) STOP 1
14 if (s .ne. 'This is a test string') STOP 2
15 end if
16 end subroutine foo
17 subroutine bar (s)
18 character*42 s
19 if (s .ne. '0123456789012345678901234567890123456') STOP 3
20 call foo (.false.)
21 end subroutine bar
22 subroutine baz
23 character*42 s
24 ! Just clobber stack a little bit.
25 s = '0123456789012345678901234567890123456'
26 call bar (s)
27 end subroutine baz
28 call foo (.true.)
29 call baz
30 call foo (.false.)
31 end