1 /* { dg-do compile } */ 2 /* { dg-options "-Os" } */ 3 4 float dhistory[10]; 5 float test; 6 getSlope(float history[])7float 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; 14 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); 21 } 22 23 rate = sumy+sumx+sumxsq; 24 return rate; 25 } 26 loop()27void loop() { 28 test = getSlope(dhistory); 29 } 30