summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/bound_5.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/bound_5.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/bound_5.f9026
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/bound_5.f90 b/gcc/testsuite/gfortran.dg/bound_5.f90
new file mode 100644
index 000000000..04245d6d8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bound_5.f90
@@ -0,0 +1,26 @@
+! { dg-do run }
+!
+! PR fortran/38859
+! Wrong bounds simplification
+!
+! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+
+ type x
+ integer I
+ end type x
+ type (x) A(0:5, 2:8)
+ integer ida(2)
+
+ ida = lbound(a)
+ if (any(ida /= (/0,2/))) call abort
+
+ ida = lbound(a%i)
+ if (any(ida /= (/1,1/))) call abort
+
+ ida = ubound(a)
+ if (any(ida /= (/5,8/))) call abort
+
+ ida = ubound(a%i)
+ if (any(ida /= (/6,7/))) call abort
+
+ end