Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-30.c
blobc6f03ed212199f69db67db653b464440987dc47d
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
9 float a[N];
10 float c[N];
12 int main1 (int n)
14 int i=0;
16 /* Vectorized: unknown loop bound. */
17 while (n--) {
18 a[i] = b[i];
19 i++;
22 /* check results: */
23 for (i = 0; i < n; i++)
25 if (a[i] != b[i])
26 abort ();
29 return 0;
32 int main2 (unsigned int n)
34 int i=0;
35 int nn = n;
37 /* Vectorized: unknown loop bound. */
38 while (n--) {
39 c[i] = b[i];
40 i++;
43 /* check results: */
44 for (i = 0; i < nn; i++)
46 if (c[i] != b[i])
47 abort ();
50 return 0;
53 int main (void)
55 check_vect ();
57 main1 (N);
58 main2 (N);
59 return 0;
62 /* Need misalignment support, or cgraph to delay emitting the arrays until
63 after vectorization can force-align them. */
64 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align } } } */