diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/value_3.f90 | |
download | cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.bz2 cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/value_3.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/value_3.f90 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/value_3.f90 b/gcc/testsuite/gfortran.dg/value_3.f90 new file mode 100644 index 000000000..c5d2d1f27 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/value_3.f90 @@ -0,0 +1,53 @@ +! { dg-do compile } +! Tests the constraints in the patch for PR29642, which requested the +! implementation of the F2003 VALUE attribute for gfortran. +! +! Contributed by Paul Thomas <pault@gcc.gnu.org> +! +program test_value + integer(8) :: i = 42, j ! { dg-error "not a dummy" } + integer(8), value :: k ! { dg-error "not a dummy" } + value :: j + +contains + subroutine bar_1 (i) + integer(8) :: i + dimension i(8) + value :: i ! { dg-error "conflicts with DIMENSION" } + i = 0 + end subroutine bar_1 + + subroutine bar_2 (i) + integer(8) :: i + pointer :: i + value :: i ! { dg-error "conflicts with POINTER" } + i = 0 + end subroutine bar_2 + + integer function bar_3 (i) + integer(8) :: i + dimension i(8) + value :: bar_3 ! { dg-error "conflicts with FUNCTION" } + i = 0 + bar_3 = 0 + end function bar_3 + + subroutine bar_4 (i, j) + integer(8), intent(inout) :: i + integer(8), intent(out) :: j + value :: i ! { dg-error "conflicts with INTENT" } + value :: j ! { dg-error "conflicts with INTENT" } + i = 0 + j = 0 + end subroutine bar_4 + + integer function bar_5 () + integer(8) :: i + external :: i + integer, parameter :: j = 99 + value :: i ! { dg-error "conflicts with EXTERNAL" } + value :: j ! { dg-error "PARAMETER attribute conflicts with" } + bar_5 = 0 + end function bar_5 + +end program test_value |