Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-9.c
blob8c5c611947f720c9ef744c33bdd09a78967d4a4c
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 uresult[N];
10 signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11 short result[N];
13 /* Unsigned type promotion (qi->hi) */
14 __attribute__ ((noinline)) int
15 foo1(int len) {
16 int i;
18 for (i=0; i<len; i++) {
19 uresult[i] = (unsigned short)uX[i];
23 /* Signed type promotion (qi->hi) */
24 __attribute__ ((noinline)) int
25 foo2(int len) {
26 int i;
28 for (i=0; i<len; i++) {
29 result[i] = (short)X[i];
33 int main (void)
35 int i;
37 check_vect ();
39 for (i=0; i<N; i++) {
40 X[i] = 16-i;
41 uX[i] = 16-i;
42 __asm__ volatile ("");
45 foo1 (N);
47 for (i=0; i<N; i++) {
48 if (uresult[i] != (unsigned short)uX[i])
49 abort ();
52 foo2 (N);
54 for (i=0; i<N; i++) {
55 if (result[i] != (short)X[i])
56 abort ();
59 return 0;
62 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */