mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-25 21:00:00 +00:00
New testcase from GCC doing array operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a59c266d84
commit
9674104416
30
test/array.c
Normal file
30
test/array.c
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user