summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/graphite/interchange-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/graphite/interchange-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-2.c b/gcc/testsuite/gcc.dg/graphite/interchange-2.c
new file mode 100644
index 00000000000..5a64f9a6f47
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-2.c
@@ -0,0 +1,24 @@
+/* Formerly known as ltrans-2.c */
+
+double u[1782225];
+int foo(int N, int *res)
+{
+ unsigned int i, j;
+ double sum = 0;
+
+ /* This loop should be converted to a perfect nest and
+ interchanged. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ sum = sum + u[i + 1335 * j];
+ if (j == N - 1)
+ u[1336 * i] *= 2;
+ }
+ }
+ *res = sum + N;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */