openmp: Add testcases for omp_max_vf
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / if-cvt-stores-vect-ifcvt-18.c
blobfc710637ac8142778b18810cefadf00dda3f39a6
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 50
8 typedef struct {
9 short a;
10 short b;
11 } data;
13 data in1[N], in2[N], out[N];
14 short result[N*2] = {10,-7,11,-6,12,-5,13,-4,14,-3,15,-2,16,-1,17,0,18,1,19,2,20,3,21,4,22,5,23,6,24,7,25,8,26,9,27,10,28,11,29,12,30,13,31,14,32,15,33,16,34,17,35,18,36,19,37,20,38,21,39,22,40,23,41,24,42,25,43,26,44,27,45,28,46,29,47,30,48,31,49,32,50,33,51,34,52,35,53,36,54,37,55,38,56,39,57,40,58,41,59,42};
15 short out1[N], out2[N];
17 __attribute__ ((noinline)) void
18 foo ()
20 int i;
21 short c, d;
23 for (i = 0; i < N; i++)
25 c = in1[i].b;
26 d = in2[i].b;
28 if (c >= d)
30 out[i].b = in1[i].a;
31 out[i].a = d + 5;
33 else
35 out[i].b = d - 12;
36 out[i].a = in2[i].a + d;
41 int
42 main (void)
44 int i;
46 check_vect ();
48 for (i = 0; i < N; i++)
50 in1[i].a = i;
51 in1[i].b = i + 2;
52 in2[i].a = 5;
53 in2[i].b = i + 5;
54 __asm__ volatile ("");
57 foo ();
59 #pragma GCC novector
60 for (i = 0; i < N; i++)
62 if (out[i].a != result[2*i] || out[i].b != result[2*i+1])
63 abort ();
66 return 0;
69 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */