2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-30.c
blob71f7a2d169f44990a59f57dcecd83e0a2824f81d
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 __attribute__ ((noinline))
13 int main1 (int n)
15 int i=0;
17 /* Vectorized: unknown loop bound. */
18 while (n--) {
19 a[i] = b[i];
20 i++;
23 /* check results: */
24 for (i = 0; i < n; i++)
26 if (a[i] != b[i])
27 abort ();
30 return 0;
33 __attribute__ ((noinline))
34 int main2 (unsigned int n)
36 int i=0;
37 int nn = n;
39 /* Vectorized: unknown loop bound. */
40 while (n--) {
41 c[i] = b[i];
42 i++;
45 /* check results: */
46 for (i = 0; i < nn; i++)
48 if (c[i] != b[i])
49 abort ();
52 return 0;
55 int main (void)
57 check_vect ();
59 main1 (N);
60 main2 (N);
61 return 0;
64 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */