cfgexpand: Expand comment on when non-var clobbers can show up
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-10.c
blobc47cf8c11d9ade3c4053f3fcf18bf719fe58c971
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__(__BIGGEST_ALIGNMENT__)));
9 unsigned short uY[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 unsigned int uresult[N];
11 signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 signed short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13 int result[N];
15 /* Unsigned type promotion (hi->si) */
16 __attribute__ ((noinline)) int
17 foo1(int len) {
18 int i;
20 for (i=0; i<len; i++) {
21 uX[i] = 5;
22 uresult[i] = (unsigned int)uY[i];
26 /* Signed type promotion (hi->si) */
27 __attribute__ ((noinline)) int
28 foo2(int len) {
29 int i;
31 for (i=0; i<len; i++) {
32 uX[i] = 5;
33 result[i] = (int)Y[i];
37 int main (void)
39 int i;
41 check_vect ();
43 for (i=0; i<N; i++) {
44 X[i] = 16-i;
45 uX[i] = 16-i;
46 __asm__ volatile ("");
49 foo1 (N);
51 #pragma GCC novector
52 for (i=0; i<N; i++) {
53 if (uresult[i] != (unsigned short)uY[i])
54 abort ();
57 foo2 (N);
59 #pragma GCC novector
60 for (i=0; i<N; i++) {
61 if (result[i] != (short)Y[i])
62 abort ();
65 return 0;
68 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */