aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2018-03-03 19:59:54 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2018-03-03 19:59:54 +0000
commit42ce31c577360ba74265e1347493028e3cb6175f (patch)
tree584ed6d2fd4667464b03694fc9597c374a880412 /gcc
parent94e6b5e5a65e83b71a1a3f736dd7e0e9f460af9c (diff)
downloadgcc-42ce31c577360ba74265e1347493028e3cb6175f.zip
gcc-42ce31c577360ba74265e1347493028e3cb6175f.tar.gz
gcc-42ce31c577360ba74265e1347493028e3cb6175f.tar.bz2
re PR fortran/66128 (ICE for some intrinsics with zero sized array parameter)
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/66128 * gfortran.dg/zero_sized_8.f90: Really commit new test. From-SVN: r258224
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog2
-rw-r--r--gcc/testsuite/gfortran.dg/zero_sized_8.f9050
2 files changed, 51 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1df6a18..45b72e5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,7 +1,7 @@
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66128
- * gfortran.dg/zero_sized_8.f90: New test.
+ * gfortran.dg/zero_sized_8.f90: Really commit New test.
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/zero_sized_8.f90 b/gcc/testsuite/gfortran.dg/zero_sized_8.f90
new file mode 100644
index 0000000..6faea88
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/zero_sized_8.f90
@@ -0,0 +1,50 @@
+! { dg-do run }
+program p
+ complex, parameter :: a(0) = 0
+ real, parameter :: x(0) = 0
+ integer, parameter :: z(0) = 0
+ if (any(z > 0) .neqv. .false.) stop 1
+ if (all(z > 0) .neqv. .true.) stop 2
+ if (count(z > 0) /= 0) stop 3
+ if (kind(count(z > 0, kind=1)) /= 1) stop 4
+ if (iall(z) /= not(int(0, kind(z)))) stop 5
+ if (iany(z) /= 0) stop 6
+ if (iparity(z) /= 0) stop 7
+ if (maxval(z) /= -huge(0) - 1) stop 8
+ if (maxval(x) /= -huge(x)) stop 9
+ if (minval(z) /= huge(0)) stop 10
+ if (minval(x) /= huge(x)) stop 11
+ if (norm2(x) /= 0) stop 12
+ if (real(product(a)) /= 1 .and. aimag(product(a)) /= 0) stop 13
+ if (product(x) /= 1) stop 14
+ if (product(z) /= 1) stop 15
+ if (real(sum(a)) /= 0 .and. aimag(sum(a)) /= 0) stop 13
+ if (sum(x) /= 0) stop 14
+ if (sum(z) /= 0) stop 15
+ call q
+end
+
+subroutine q
+ complex, parameter :: a(0) = 0
+ real, parameter :: x(3,4,0) = 0
+ integer, parameter :: z(3,4,0) = 0
+ if (any(z > 0) .neqv. .false.) stop 101
+ if (all(z > 0) .neqv. .true.) stop 102
+ if (count(z > 0) /= 0) stop 103
+ if (kind(count(z > 0, kind=1)) /= 1) stop 104
+ if (iall(z) /= not(int(0, kind(z)))) stop 105
+ if (iany(z) /= 0) stop 106
+ if (iparity(z) /= 0) stop 107
+ if (maxval(z) /= -huge(0) - 1) stop 108
+ if (maxval(x) /= -huge(x)) stop 109
+ if (minval(z) /= huge(0)) stop 110
+ if (minval(x) /= huge(x)) stop 111
+ if (norm2(x) /= 0) stop 112
+ if (real(product(a)) /= 1 .and. aimag(product(a)) /= 0) stop 113
+ if (product(x) /= 1) stop 114
+ if (product(z) /= 1) stop 115
+ if (real(sum(a)) /= 0 .and. aimag(sum(a)) /= 0) stop 13
+ if (sum(x) /= 0) stop 14
+ if (sum(z) /= 0) stop 15
+end
+! { dg-prune-output "symmetric range implied by Standard" }