PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-17.c
blob79ad80e3013e189c0efb9425de2b507cf486f39a
1 /* { dg-require-effective-target vect_long_long } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
9 unsigned char uresultX[N];
10 unsigned long long uY[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
11 unsigned char uresultY[N];
13 /* Unsigned type demotion (si->qi) */
15 __attribute__ ((noinline)) int
16 foo1(int len) {
17 int i;
19 for (i=0; i<len; i++) {
20 uresultX[i] = uX[i];
21 uresultY[i] = (unsigned char)uY[i];
25 int main (void)
27 int i;
29 check_vect ();
31 foo1 (N);
33 for (i=0; i<N; i++) {
34 if (uresultX[i] != uX[i])
35 abort ();
36 if (uresultY[i] != (unsigned char)uY[i])
37 abort ();
40 return 0;
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */