libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-fncall-mask.c
blob554488e06308717eacca79003d96555d99c7c0f5
1 /* { dg-do compile { target { aarch64*-*-* } } } */
2 /* { dg-additional-options "-march=armv8.2-a+sve -fdump-tree-ifcvt-raw -Ofast" { target { aarch64*-*-* } } } */
4 extern int __attribute__ ((simd, const)) fn (int);
6 const int N = 20;
7 const float lim = 101.0;
8 const float cst = -1.0;
9 float tot = 0.0;
11 float b[20];
12 float a[20] = { [0 ... 9] = 1.7014118e39, /* If branch. */
13 [10 ... 19] = 100.0 }; /* Else branch. */
15 int main (void)
17 #pragma omp simd
18 for (int i = 0; i < N; i += 1)
20 if (a[i] > lim)
21 b[i] = cst;
22 else
23 b[i] = fn (a[i]);
24 tot += b[i];
26 return (0);
29 /* { dg-final { scan-tree-dump {gimple_assign <gt_expr, _12, _1, 1.01e\+2, NULL>} ifcvt } } */
30 /* { dg-final { scan-tree-dump {gimple_assign <bit_not_expr, _34, _12, NULL, NULL>} ifcvt } } */
31 /* { dg-final { scan-tree-dump {gimple_call <.MASK_CALL, _3, fn, _2, _34>} ifcvt } } */