From abc1609342fd0a9a64a6c9d239fdd3adabdcc044 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 15 Jul 2001 00:18:50 +0000 Subject: [PATCH] New testcase from GCC doing array operations llvm-svn: 192 --- llvm/test/array.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 llvm/test/array.c diff --git a/llvm/test/array.c b/llvm/test/array.c new file mode 100644 index 000000000000..c24321e8fbee --- /dev/null +++ b/llvm/test/array.c @@ -0,0 +1,30 @@ +extern printf(const char *, double, double); + +int +checkIdxCode(int N, int* A, float F[][30]) +{ + int i, j; + float sumA=0.0, sumF=0.0; + for (i=0; i < 12; i++) + { + sumA = sumA + A[i]; + for (j=0; j < 10; j++) + { + F[i][j] = 0.5 * (F[i][j-1] + F[i-1][j]); + sumF = sumF + F[i][j]; + } + } + printf("sumA = %lf, sumF = %lf\n", sumA, sumF); +} + +#if 0 +int +main(int argc, char** argv) +{ + int N = argc+20; + int* A = (int*) malloc(N * sizeof(int)); + float F[25][30]; + return checkIdxCode(N, A, F); +} + +#endif