Patchwork [2/6] Add testcase for PR29832.

login
register
mail settings
Submitter Sebastian Pop
Date Jan. 18, 2011, 8:51 p.m.
Message ID <1295383896-27122-3-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/79355/
State New
Headers show

Comments

Sebastian Pop - Jan. 18, 2011, 8:51 p.m.
2011-01-18  Sebastian Pop  <sebastian.pop@amd.com>

	PR tree-optimization/29832
	* gfortran.dg/graphite/pr29832.f90: New.
---
 gcc/ChangeLog.graphite                         |    5 ++++
 gcc/testsuite/gfortran.dg/graphite/pr29832.f90 |   26 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/graphite/pr29832.f90

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 8440b84..ee16496 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@ 
 2011-01-18  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR tree-optimization/29832
+	* gfortran.dg/graphite/pr29832.f90: New.
+
+2011-01-18  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR tree-optimization/43567
 	* gcc.dg/graphite/pr43567.c: New.
 
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr29832.f90 b/gcc/testsuite/gfortran.dg/graphite/pr29832.f90
new file mode 100644
index 0000000..ab222ab
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr29832.f90
@@ -0,0 +1,26 @@ 
+! { dg-do run }
+! { dg-options "-O2 -ftree-loop-linear" }
+
+! Program to test the scalarizer
+program testarray
+   implicit none
+   integer, dimension (6, 5) :: a, b
+   integer n
+
+   a = 0
+   do n = 1, 5
+      a(4, n) = n
+   end do
+
+   b(:, 5:1:-1) = a
+   a(1:5, 2) = a(4, :) + 1
+
+   ! The following expression should cause loop reordering
+   a(:, 2:4) = a(:, 1:3)
+
+   do n = 1, 5
+      if (a(n, 3) .ne. (n + 1)) call abort
+      if (b(4, n) .ne. (6 - n)) call abort
+   end do
+end program
+