re PR fortran/89866 ([F08] wrong-code problem with POINTER, INTENT(IN) argument)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 30 Mar 2019 13:41:10 +0000 (13:41 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 30 Mar 2019 13:41:10 +0000 (13:41 +0000)
2019-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/89866
* gfortran.dg/pointer_intent_8.f90: New test.

From-SVN: r270034

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pointer_intent_8.f90 [new file with mode: 0644]

index f5f5bbf24f364cb96ccb23ef9b6fb18cc2b91a12..9c583a38e74b9b874ba63a0e2c1282c395fca2c3 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/89866
+       * gfortran.dg/pointer_intent_8.f90: New test.
+
 2019-03-29  Jim Wilson  <jimw@sifive.com>
 
        * gcc.target/riscv/predef-1.c: New.
diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_8.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_8.f90
new file mode 100644 (file)
index 0000000..6bfbc5c
--- /dev/null
@@ -0,0 +1,22 @@
+! { dg-do run }
+! PR 85797 - this used to get wrong results.
+
+
+PROGRAM testfortran2
+  IMPLICIT NONE
+
+  INTEGER, DIMENSION(10), TARGET :: i4array
+
+  i4array = (/ 1,2,3,4,5,6,7,8,9,10 /)
+
+  call InRef(i4array)
+
+CONTAINS
+
+  subroutine InRef(v)
+    INTEGER, DIMENSION(:), POINTER, INTENT(in) :: v
+    INTEGER :: i
+    if (any (v /= [(i,i=1,10)])) stop 1
+  END subroutine
+
+END