summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.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/intrinsic_pack_4.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_pack_4.f9072
1 files changed, 72 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90
new file mode 100644
index 000000000..691036817
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90
@@ -0,0 +1,72 @@
+! { dg-do run }
+! PR 35990 - some empty array sections caused pack to crash.
+! Test case contributed by Dick Hendrickson, adjusted and
+! extended by Thomas Koenig.
+ program try_gf1048
+
+ call gf1048a( 10, 8, 7, 1, 0, .true.)
+ call gf1048b( 10, 8, 7, 1, 0, .true.)
+ call gf1048c( 10, 8, 7, 1, 0, .true.)
+ call gf1048d( 10, 8, 7, 1, 0, .true.)
+ call P_inta ( 10, 8, 7, 1, 0, .true.)
+ call P_intb ( 10, 8, 7, 1, 0, .true.)
+ call P_intc ( 10, 8, 7, 1, 0, .true.)
+ call P_intd ( 10, 8, 7, 1, 0, .true.)
+ end program
+
+ SUBROUTINE GF1048a(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(10)
+ BDA( 8:7) = PACK(BDA1( 10: 1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE GF1048b(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF8:NF7), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE GF1048c(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE GF1048d(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTa(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(10)
+ BDA( 8:7) = PACK(BDA1( 10: 1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTb(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF8:NF7), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTc(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTd(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+