diff options
author | Mark Doffman <mark.doffman@codethink.co.uk> | 2018-03-15 23:07:39 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-03-15 23:07:39 -0600 |
commit | 9f3599c044810c4fd17f1f36ec024c55a35021fd (patch) | |
tree | 9fb13ff3d92b7dd0c0b8e9d83b730caa32c04f8e | |
parent | 64300da748c4b945cd384d20c4ac85a8db4caaba (diff) | |
download | gcc-9f3599c044810c4fd17f1f36ec024c55a35021fd.zip gcc-9f3599c044810c4fd17f1f36ec024c55a35021fd.tar.gz gcc-9f3599c044810c4fd17f1f36ec024c55a35021fd.tar.bz2 |
03-16-2018 Mark Doffman <mark.doffman@codethink.co.uk>
Jim MacArthur <jim.macarthur@codethink.co.uk>
* gfortran.dg/automatic_1.f90: New test.
* gfortran.dg/automatic_repeat.f90: New test
* gfortran.dg/automatic_save.f90: New test.
* gfortran.dg/vax_structure.f90: New test.
From-SVN: r258584
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/automatic_1.f90 | 31 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/automatic_repeat.f90 | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/automatic_save.f90 | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/vax_structure_1.f90 | 27 |
5 files changed, 82 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a07069f..14e70af 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +03-16-2018 Mark Doffman <mark.doffman@codethink.co.uk> + Jim MacArthur <jim.macarthur@codethink.co.uk> + + * gfortran.dg/automatic_1.f90: New test. + * gfortran.dg/automatic_repeat.f90: New test + * gfortran.dg/automatic_save.f90: New test. + * gfortran.dg/vax_structure.f90: New test. + 2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/78741 diff --git a/gcc/testsuite/gfortran.dg/automatic_1.f90 b/gcc/testsuite/gfortran.dg/automatic_1.f90 new file mode 100644 index 0000000..910dcb1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/automatic_1.f90 @@ -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 diff --git a/gcc/testsuite/gfortran.dg/automatic_repeat.f90 b/gcc/testsuite/gfortran.dg/automatic_repeat.f90 new file mode 100644 index 0000000..5c3133a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/automatic_repeat.f90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! { dg-options "-fdec-static" } +! An AUTOMATIC statement cannot duplicated +FUNCTION X() +REAL, AUTOMATIC, AUTOMATIC :: Y ! { dg-error "Duplicate AUTOMATIC attribute" } +y = 1 +END FUNCTION X +END diff --git a/gcc/testsuite/gfortran.dg/automatic_save.f90 b/gcc/testsuite/gfortran.dg/automatic_save.f90 new file mode 100644 index 0000000..2455d20 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/automatic_save.f90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! { dg-options "-fdec-static" } +! An AUTOMATIC statement cannot be used with SAVE +FUNCTION X() +REAL, SAVE, AUTOMATIC :: Y ! { dg-error "AUTOMATIC attribute conflicts with SAVE attribute" } +y = 1 +END FUNCTION X +END diff --git a/gcc/testsuite/gfortran.dg/vax_structure_1.f90 b/gcc/testsuite/gfortran.dg/vax_structure_1.f90 new file mode 100644 index 0000000..2658c12 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/vax_structure_1.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! { dg-options "-fdec-structure" } +! Tests the VAX STRUCTURE and RECORD statements. +! These are syntactic sugar for TYPE statements. + + program vax_structure_1 + structure /stocklevel/ + integer*2 A + integer*4 B + integer*4 CS(0:15) + byte D(0:15) + end structure + + record /stocklevel/ rec1, recs(100) + integer x + integer*2 y + + rec1.A = 100 + recs(100).CS(10)=1 + x = 150 + y = 150 + + print *, rec1.B.eq.100 + print *, rec1.A.eq.x ! {dg-error "are INTEGER(2)/INTEGER(4)"} + print *, rec1.A.eq.y + print *, recs(100).CS(10) + end program |