1 /* { dg-do assemble { target aarch64_asm_sve_ok } } */
2 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details --save-temps" } */
3 
4 #include <stdint.h>
5 
6 #if !defined(TYPE)
7 #define TYPE uint32_t
8 #endif
9 
10 #define N 254
11 
12 /* Non-simple condition reduction.  */
13 
14 TYPE __attribute__ ((noinline, noclone))
condition_reduction(TYPE * a,TYPE min_v)15 condition_reduction (TYPE *a, TYPE min_v)
16 {
17   TYPE last = 65;
18 
19   for (TYPE i = 0; i < N; i++)
20     if (a[i] < min_v)
21       last = a[i];
22 
23   return last;
24 }
25 
26 /* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
27 /* { dg-final { scan-assembler {\tclastb\ts[0-9]+, p[0-7], s[0-9]+, z[0-9]+\.s} } } */
28