2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / save_1.f90
blob614986277a85aaeafc0e9bf2383c3fa850c490d4
1 ! { dg-options "-O2 -fno-automatic" }
2 subroutine foo (b)
3 logical b
4 integer i, j
5 character*24 s
6 save i
7 if (b) then
8 i = 26
9 j = 131
10 s = 'This is a test string'
11 else
12 if (i .ne. 26 .or. j .ne. 131) call abort
13 if (s .ne. 'This is a test string') call abort
14 end if
15 end subroutine foo
16 subroutine bar (s)
17 character*42 s
18 if (s .ne. '0123456789012345678901234567890123456') call abort
19 call foo (.false.)
20 end subroutine bar
21 subroutine baz
22 character*42 s
23 ! Just clobber stack a little bit.
24 s = '0123456789012345678901234567890123456'
25 call bar (s)
26 end subroutine baz
27 call foo (.true.)
28 call baz
29 call foo (.false.)
30 end