Patchwork [6/6] Add testcase for PR46970.

login
register
mail settings
Submitter Sebastian Pop
Date Jan. 18, 2011, 8:51 p.m.
Message ID <1295383896-27122-7-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/79359/
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/46970
	* gcc.dg/graphite/pr46970.c: New.
---
 gcc/ChangeLog.graphite                  |    5 +++++
 gcc/testsuite/gcc.dg/graphite/pr46970.c |   28 ++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr46970.c

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 03a9e56..ed3e4ab 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/46970
+	* gcc.dg/graphite/pr46970.c: New.
+
+2011-01-18  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR tree-optimization/46215
 	* gcc.dg/graphite/pr46215.c: New.
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr46970.c b/gcc/testsuite/gcc.dg/graphite/pr46970.c
new file mode 100644
index 0000000..b1ef7d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr46970.c
@@ -0,0 +1,28 @@ 
+/* { dg-do run } */
+/* { dg-options "-Os -ftree-loop-linear" } */
+
+#define N 16
+
+int
+main1 (int n, int *a)
+{
+  int i, j;
+
+  for (i = 0; i < n; i++)
+    for (j = 0; j < n; j++)
+      a[j] = i + n;
+
+  for (j = 0; j < n; j++)
+    if (a[j] != i + n - 1)
+      __builtin_abort ();
+
+  return 0;
+}
+
+int
+main ()
+{
+  int a[N];
+  main1 (N, a);
+  return 0;
+}