Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-cast-2.c
blob348a2d0f8335c705d552c74ffc0f4533891c819b
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 unsigned char uX[N] __attribute__ ((__aligned__(16)));
9 unsigned char uresultX[N];
10 unsigned int uY[N] __attribute__ ((__aligned__(16)));
11 unsigned short uresultY[N];
13 int
14 foo1(int len) {
15 int i;
17 for (i=0; i<len; i++) {
18 uresultX[i] = uX[i];
19 uresultY[i] = (unsigned short)uY[i];
23 int main (void)
25 int i;
27 check_vect ();
29 for (i=0; i<N; i++) {
30 uX[i] = 16-i;
31 uY[i] = 16-i;
34 foo1 (N);
36 for (i=0; i<N; i++) {
37 if (uresultX[i] != uX[i])
38 abort ();
39 if (uresultY[i] != (unsigned short)uY[i])
40 abort ();
43 return 0;
46 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* } } } */
47 /* { dg-final { cleanup-tree-dump "vect" } } */