aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f9029
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90
new file mode 100644
index 000000000..c838baa98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90
@@ -0,0 +1,29 @@
+ subroutine foo (b)
+ logical b
+ integer i, j
+ character*24 s
+ save
+ if (b) then
+ i = 26
+ j = 131
+ s = 'This is a test string'
+ else
+ if (i .ne. 26 .or. j .ne. 131) call abort
+ if (s .ne. 'This is a test string') call abort
+ end if
+ end subroutine foo
+ subroutine bar (s)
+ character*42 s
+ if (s .ne. '0123456789012345678901234567890123456') call abort
+ call foo (.false.)
+ end subroutine bar
+ subroutine baz
+ character*42 s
+ ! Just clobber stack a little bit.
+ s = '0123456789012345678901234567890123456'
+ call bar (s)
+ end subroutine baz
+ call foo (.true.)
+ call baz
+ call foo (.false.)
+ end