Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-cast-1.c
bloba3a509bb6bb2a7643ad993a152f99a0c07d03215
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 short uresult[N];
10 signed char X[N] __attribute__ ((__aligned__(16)));
11 short result[N];
13 int
14 foo1(int len) {
15 int i;
17 for (i=0; i<len; i++) {
18 uresult[i] = (unsigned short)uX[i];
22 int
23 foo2(int len) {
24 int i;
26 for (i=0; i<len; i++) {
27 result[i] = (short)X[i];
31 int main (void)
33 int i;
35 check_vect ();
37 for (i=0; i<N; i++) {
38 X[i] = 16-i;
39 uX[i] = 16-i;
42 foo1 (N);
44 for (i=0; i<N; i++) {
45 if (uresult[i] != (unsigned short)uX[i])
46 abort ();
49 foo2 (N);
51 for (i=0; i<N; i++) {
52 if (result[i] != (short)X[i])
53 abort ();
56 return 0;
59 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target powerpc*-*-* } } } */
60 /* { dg-final { cleanup-tree-dump "vect" } } */