libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-conditional_store_4.c
blob18ef42e6ad3470498750f83aa6d11fb8513545f4
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-require-effective-target vect_masked_store } */
5 /* { dg-additional-options "-mavx2" { target avx2 } } */
6 /* { dg-additional-options "-march=armv9-a" { target aarch64-*-* } } */
8 void foo4 (signed char *restrict a, int *restrict b, int *restrict c, int *restrict d, int n, int stride)
10 if (stride <= 1)
11 return;
13 for (int i = 0; i < n; i++)
15 int res1 = c[i];
16 int res2 = d[i];
17 int t = b[i+stride];
18 if (a[i] > 0)
19 t = res1;
20 else if (a[i] < 0)
21 t = res2 * 2;
23 c[i] = t;
27 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
28 /* { dg-final { scan-tree-dump-times "VEC_COND_EXPR " "vect" 1 { target aarch64-*-* } } } */