summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-04 19:07:28 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-04 19:07:28 +0000
commit393a1b6c281d6fd3b90451c3928dbf68ac308d09 (patch)
treeb2ffeecf45cdd998f85c6ea3842a5747af150b22 /gcc/testsuite/gfortran.dg
parent501ec29ae3539d16f7107b8880044505506828c5 (diff)
downloadgcc-393a1b6c281d6fd3b90451c3928dbf68ac308d09.tar.gz
2008-05-04 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/35995 * m4/ifunction_logical.m4: If the extent of "array" is less than zero, set it to zero. Use an explicit flag for breaking out of the main loop to avoid, because the data pointer for "array" may be NULL for an empty array. * m4/ifunction.m4: Likewise. * generated/all_l1.c: Regenerated. * generated/all_l16.c: Regenerated. * generated/all_l2.c: Regenerated. * generated/all_l4.c: Regenerated. * generated/all_l8.c: Regenerated. * generated/any_l1.c: Regenerated. * generated/any_l16.c: Regenerated. * generated/any_l2.c: Regenerated. * generated/any_l4.c: Regenerated. * generated/any_l8.c: Regenerated. * generated/count_16_l.c: Regenerated. * generated/count_1_l.c: Regenerated. * generated/count_2_l.c: Regenerated. * generated/count_4_l.c: Regenerated. * generated/count_8_l.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2008-05-04 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/35995 * gfortran.dg/intrinsic_ifunction_1.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134934 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f9043
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f90
new file mode 100644
index 00000000000..a27c220ee46
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+! PR 35995 - ifunction.m4 and ifunction_logical.m4 had a bug
+! where zero-sized arguments were not handled correctly.
+! Test case provided by Dick Hendrickson, amended by
+! Thomas Koenig.
+
+ program try_gf0026_etc
+
+ call gf0026( 0, 1)
+ call foo ( 0, 1)
+
+ end program
+
+ SUBROUTINE GF0026(nf0,nf1)
+ LOGICAL LDA(9)
+ INTEGER IDA(NF0,9), iii(9)
+
+ lda = (/ (i/2*2 .eq. I, i=1,9) /)
+ LDA = ALL ( IDA .NE. -1000, 1)
+ if (.not. all(lda)) call abort
+ if (.not. all(ida .ne. -1000)) call abort
+
+ lda = (/ (i/2*2 .eq. I, i=1,9) /)
+ LDA = any ( IDA .NE. -1000, 1)
+ print *, lda !expect FALSE
+ if (any(lda)) call abort
+ print *, any(ida .ne. -1000) !expect FALSE
+ if (any(ida .ne. -1000)) call abort
+
+ iii = 137
+ iii = count ( IDA .NE. -1000, 1)
+ if (any(iii /= 0)) call abort
+ if (count(ida .ne. -1000) /= 0) call abort
+
+ END SUBROUTINE
+
+ subroutine foo (nf0, nf1)
+ integer, dimension(9):: res, iii
+ integer, dimension(nf0,9) :: ida
+ res = (/ (-i, i=1,9) /)
+ res = product (ida, 1)
+ if (any(res /= 1)) call abort
+ end subroutine foo