diff gcc/testsuite/gfortran.dg/automatic_1.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gfortran.dg/automatic_1.f90	Thu Oct 25 07:37:49 2018 +0900
@@ -0,0 +1,31 @@
+! { dg-do run }
+! { dg-options "-O2 -fdec-static -fno-automatic" }
+      subroutine foo (b)
+        logical b
+        integer i, j
+        character*24 s
+        automatic i
+        if (b) then
+          i = 26
+          j = 131
+          s = 'This is a test string'
+        else
+          if (i .eq. 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