summaryrefslogtreecommitdiffstats
path: root/polly/test/CodeGen/reduction.c
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2011-04-29 06:27:02 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2011-04-29 06:27:02 +0000
commit758053788bde4747953f5f276ded345cd01323b1 (patch)
tree02f38df95a5327cb8644906d148b5bd8facf63f9 /polly/test/CodeGen/reduction.c
parent011eae75123217b9125270ae08132a308cee7061 (diff)
downloadbcm5719-llvm-758053788bde4747953f5f276ded345cd01323b1.tar.gz
bcm5719-llvm-758053788bde4747953f5f276ded345cd01323b1.zip
Add initial version of Polly
This version is equivalent to commit ba26ebece8f5be84e9bd6315611d412af797147e in the old git repository. llvm-svn: 130476
Diffstat (limited to 'polly/test/CodeGen/reduction.c')
-rw-r--r--polly/test/CodeGen/reduction.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/polly/test/CodeGen/reduction.c b/polly/test/CodeGen/reduction.c
new file mode 100644
index 00000000000..73a5e1e5381
--- /dev/null
+++ b/polly/test/CodeGen/reduction.c
@@ -0,0 +1,27 @@
+#include <string.h>
+#include <stdio.h>
+#define N 1021
+
+int main () {
+ int i;
+ int A[N];
+ int red;
+
+ memset(A, 0, sizeof(int) * N);
+
+ A[0] = 1;
+ A[1] = 1;
+ red = 0;
+
+ __sync_synchronize();
+
+ for (i = 2; i < N; i++) {
+ A[i] = A[i-1] + A[i-2];
+ red += A[i-2];
+ }
+
+ __sync_synchronize();
+
+ if (red != 382399368)
+ return 1;
+}
OpenPOWER on IntegriCloud