2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-7.c
blob35dc08bbd2cb7ecbde0fa32ee82905f8488649fb
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 short sa[N];
9 short sb[N];
11 __attribute__ ((noinline))
12 int main1 ()
14 int i;
16 for (i = 0; i < N; i++)
18 sb[i] = 5;
21 /* check results: */
22 for (i = 0; i < N; i++)
24 if (sb[i] != 5)
25 abort ();
28 for (i = 0; i < N; i++)
30 sa[i] = sb[i] + 100;
33 /* check results: */
34 for (i = 0; i < N; i++)
36 if (sa[i] != 105)
37 abort ();
40 return 0;
43 int main (void)
45 check_vect ();
47 return main1 ();
50 /* Fails for 32-bit targets that don't vectorize PLUS. */
51 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */
52 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
53 /* { dg-final { cleanup-tree-dump "vect" } } */