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/cray_pointers_1.f90 | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.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/cray_pointers_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/cray_pointers_1.f90 | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_1.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_1.f90 new file mode 100644 index 000000000..87ace6848 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/cray_pointers_1.f90 @@ -0,0 +1,68 @@ +! { dg-do compile } +! { dg-options "-fcray-pointer" } + +! Bad type for pointer +subroutine err1 + real ipt + real array(10) + pointer (ipt, array) ! { dg-error "integer" } +end subroutine err1 + +! Multiple declarations for the same pointee +subroutine err2 + real array(10) + pointer (ipt1, array) + pointer (ipt2, array) ! { dg-error "multiple" } +end subroutine err2 + +! Vector assignment to an assumed size array +subroutine err3 + real target(10) + real array(*) + pointer (ipt, array) + ipt = loc (target) + array = 0 ! { dg-error "upper bound in the last dimension" } +end subroutine err3 + +subroutine err4 + pointer (ipt, ipt) ! { dg-error "POINTER attribute" } +end subroutine err4 + +! duplicate array specs +subroutine err5 + pointer (ipt, array(7)) + real array(10) ! { dg-error "Duplicate array" } +end subroutine err5 + +subroutine err6 + real array(10) + pointer (ipt, array(7)) ! { dg-error "Duplicate array" } +end subroutine err6 + +! parsing stuff +subroutine err7 + pointer ( ! { dg-error "variable name" } + pointer (ipt ! { dg-error "Expected" } + pointer (ipt, ! { dg-error "variable name" } + pointer (ipt,a1 ! { dg-error "Expected" } + pointer (ipt,a2), ! { dg-error "Expected" } + pointer (ipt,a3),( ! { dg-error "variable name" } + pointer (ipt,a4),(ipt2 ! { dg-error "Expected" } + pointer (ipt,a5),(ipt2, ! { dg-error "variable name" } + pointer (ipt,a6),(ipt2,a7 ! { dg-error "Expected" } +end subroutine err7 + +! more attributes +subroutine err8(array) + real array(10) + integer dim(2) + integer, pointer :: f90ptr + integer, target :: f90targ + pointer (ipt, array) ! { dg-error "DUMMY" } + pointer (dim, elt1) ! { dg-error "DIMENSION" } + pointer (f90ptr, elt2) ! { dg-error "POINTER" } + pointer (ipt, f90ptr) ! { dg-error "POINTER" } + pointer (f90targ, elt3) ! { dg-error "TARGET" } + pointer (ipt, f90targ) ! { dg-error "TARGET" } +end subroutine err8 + |