Patchwork [3/3] Add testcase for PR45758.

login
register
mail settings
Submitter Sebastian Pop
Date Sept. 23, 2010, 3:52 p.m.
Message ID <1285257170-11174-3-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/65546/
State New
Headers show

Comments

Sebastian Pop - Sept. 23, 2010, 3:52 p.m.
2010-09-23  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/45758
	* gfortran.dg/graphite/pr45758.f90: New.
---
 gcc/ChangeLog.graphite                         |    5 +++
 gcc/testsuite/gfortran.dg/graphite/pr45758.f90 |   41 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/graphite/pr45758.f90

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 9e7ff70..c63f2dc 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@ 
 2010-09-23  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR middle-end/45758
+	* gfortran.dg/graphite/pr45758.f90: New.
+
+2010-09-23  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-scop-detection.c (is_scop_p): Free bblist.
 
 2010-09-23  Sebastian Pop  <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr45758.f90 b/gcc/testsuite/gfortran.dg/graphite/pr45758.f90
new file mode 100644
index 0000000..b0e0a3d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr45758.f90
@@ -0,0 +1,41 @@ 
+! { dg-options "-O3 -floop-block" }
+
+MODULE util
+  INTEGER, PARAMETER :: int_4=4
+  INTERFACE sort
+     MODULE PROCEDURE sort_int_4v
+  END INTERFACE
+CONTAINS
+  SUBROUTINE sort_int_4v ( arr, n, index )
+    INTEGER(KIND=int_4), INTENT(INOUT)       :: arr(1:n)
+    INTEGER, INTENT(OUT)                     :: INDEX(1:n)
+    DO i = 1, n
+       INDEX(i) = i
+    END DO
+1   IF (ir-l<m) THEN
+       DO j = l + 1, ir
+          DO i = j - 1, 1, -1
+             IF (arr(i)<=a) GO TO 2
+             arr(i+1) = arr(i)
+             INDEX(i+1) = INDEX(i)
+          END DO
+2         arr(i+1) = a
+       END DO
+    END IF
+  END SUBROUTINE sort_int_4v
+  SUBROUTINE create_destination_list(list)
+    INTEGER, DIMENSION(:, :, :), POINTER     :: list
+    INTEGER                                  ::  icpu, ncpu, stat, ultimate_max
+    INTEGER, ALLOCATABLE, DIMENSION(:)       :: index, sublist
+    ultimate_max=7
+    ALLOCATE(INDEX(ultimate_max),STAT=stat)
+    CALL t(stat==0)
+    ALLOCATE(sublist(ultimate_max),STAT=stat)
+    DO icpu=0,ncpu-1
+       CALL sort(sublist,ultimate_max,index)
+       list(1,:,icpu)=sublist
+       list(2,:,icpu)=0
+    ENDDO
+  END SUBROUTINE create_destination_list
+END MODULE
+