Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ifc-pr44710.c
blobd4a1be8f03ee4871bf1cd9987fde1225c7bfd9ae
1 /* { dg-do compile } */
2 /* { dg-options "-c -O2 -ftree-vectorize" { target *-*-* } } */
4 #include <stdio.h>
5 #include <stdlib.h>
7 #define N 64
8 float arr[N];
10 __attribute__ ((noinline))
11 int foo (unsigned int n, float *min)
13 unsigned int pos = 1;
14 unsigned int i;
15 float limit = N+N;
17 for (i = 0; i < N; i++)
18 if (arr[i] < limit)
20 pos = i + 1;
21 limit = arr[i];
24 *min = limit;
25 return pos;
28 int main (void)
30 int i, pos;
31 float min;
33 for (i = 0; i < N; i++)
34 arr[i] = (float)(i);
36 arr[2] = -5.8;
38 pos = foo (N, &min);
39 if (pos != 3 || min != arr[2])
40 abort ();
42 return 0;