Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / avr / pr60040-1.c
blob4fe296b37df5ddd4950878d51c8fa75fc20ba6c5
1 /* { dg-do compile } */
2 /* { dg-options "-Os" } */
4 float dhistory[10];
5 float test;
7 float getSlope(float history[]) {
8 float sumx = 0;
9 float sumy = 0;
10 float sumxy = 0;
11 float sumxsq = 0;
12 float rate = 0;
13 int n = 10;
15 int i;
16 for (i=1; i< 11; i++) {
17 sumx = sumx + i;
18 sumy = sumy + history[i-1];
19 sumy = sumy + history[i-1];
20 sumxsq = sumxsq + (i*i);
23 rate = sumy+sumx+sumxsq;
24 return rate;
27 void loop() {
28 test = getSlope(dhistory);