Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-multitypes-10.c
blob60a4fc85481693ff76923f4c66d42b98c0fdc435
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 for (i=0; i<N; i++) {
52 if (uresult[i] != (unsigned short)uY[i])
53 abort ();
56 foo2 (N);
58 for (i=0; i<N; i++) {
59 if (result[i] != (short)Y[i])
60 abort ();
63 return 0;
66 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
67 /* { dg-final { cleanup-tree-dump "vect" } } */