summaryrefslogtreecommitdiffstats
path: root/polly/test/CodeGen/sequential_loops.c
diff options
context:
space:
mode:
Diffstat (limited to 'polly/test/CodeGen/sequential_loops.c')
-rw-r--r--polly/test/CodeGen/sequential_loops.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/polly/test/CodeGen/sequential_loops.c b/polly/test/CodeGen/sequential_loops.c
new file mode 100644
index 00000000000..4eac4b0f8ef
--- /dev/null
+++ b/polly/test/CodeGen/sequential_loops.c
@@ -0,0 +1,31 @@
+#include <string.h>
+#define N 1024
+
+int A[N];
+
+void sequential_loops() {
+ int i;
+ for (i = 0; i < N/2; i++) {
+ A[i] = 1;
+ }
+ for (i = N/2 ; i < N; i++) {
+ A[i] = 2;
+ }
+}
+
+int main () {
+ int i;
+ memset(A, 0, sizeof(int) * N);
+
+ sequential_loops();
+
+ for (i = 0; i < N; i++) {
+ if (A[i] != 1 && i < N/2)
+ return 1;
+ if (A[i] != 2 && i >= N/2)
+ return 1;
+ }
+
+ return 0;
+}
+
OpenPOWER on IntegriCloud