2004-09-19 Ira Rosen <irar@il.ibm.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-30.c
blob0e4267982645e337892b84528bd682479d573db1
1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
4 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #define N 16
11 float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
12 float a[N];
13 float c[N];
15 int main1 (int n)
17 int i=0;
19 /* Vectorized: unknown loop bound. */
20 while (n--) {
21 a[i] = b[i];
22 i++;
25 /* check results: */
26 for (i = 0; i < n; i++)
28 if (a[i] != b[i])
29 abort ();
32 return 0;
35 int main2 (unsigned int n)
37 int i=0;
38 int nn = n;
40 /* Vectorized: unknown loop bound. */
41 while (n--) {
42 c[i] = b[i];
43 i++;
46 /* check results: */
47 for (i = 0; i < nn; i++)
49 if (c[i] != b[i])
50 abort ();
53 return 0;
56 int main (void)
58 check_vect ();
60 main1 (N);
61 main2 (N);
62 return 0;
65 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail *-*-* } } } */