Avoid expicit builtion list in tree-ssa-dce
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-a-u8-i8-gap2.c
bloba9524a9d8e5cb152ec879db68f316d5568161ec1
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 24
8 typedef struct {
9 unsigned char a;
10 unsigned char b;
11 unsigned char c;
12 unsigned char d;
13 unsigned char e;
14 unsigned char f;
15 unsigned char g;
16 unsigned char h;
17 } s;
19 __attribute__ ((noinline)) int
20 main1 ()
22 int i;
23 s arr[N];
24 s *ptr = arr;
25 s res[N];
27 for (i = 0; i < N; i++)
29 arr[i].a = i;
30 arr[i].b = i * 2;
31 arr[i].c = 17;
32 arr[i].d = i+34;
33 arr[i].e = i + 5;
34 arr[i].f = i * 2 + 2;
35 arr[i].g = i - 3;
36 arr[i].h = 56;
37 asm volatile ("" ::: "memory");
40 for (i = 0; i < N; i++)
42 res[i].c = ptr->a;
43 res[i].a = ptr->f + ptr->a;
44 res[i].d = ptr->f - ptr->a;
45 res[i].b = ptr->f;
46 res[i].f = ptr->a;
47 res[i].e = ptr->f - ptr->a;
48 res[i].h = ptr->f;
49 res[i].g = ptr->f - ptr->a;
50 ptr++;
53 /* check results: */
54 #pragma GCC novector
55 for (i = 0; i < N; i++)
57 if (res[i].c != arr[i].a
58 || res[i].a != arr[i].f + arr[i].a
59 || res[i].d != arr[i].f - arr[i].a
60 || res[i].b != arr[i].f
61 || res[i].f != arr[i].a
62 || res[i].e != arr[i].f - arr[i].a
63 || res[i].h != arr[i].f
64 || res[i].g != arr[i].f - arr[i].a)
65 abort();
70 int main (void)
72 check_vect ();
74 main1 ();
76 return 0;
79 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */