* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr65947-10.c
blob9bdfd6db518455eb42fc39f475ab30b9313e43f5
1 /* { dg-require-effective-target vect_condition } */
3 #include "tree-vect.h"
5 extern void abort (void) __attribute__ ((noreturn));
7 #define N 32
9 /* Non-integer data types. */
11 float
12 condition_reduction (float *a, float min_v)
14 float last = 0;
16 for (int i = 0; i < N; i++)
17 if (a[i] < min_v)
18 last = a[i];
20 return last;
23 int
24 main (void)
26 float a[N] = {
27 11.5, 12.2, 13.22, 14.1, 15.2, 16.3, 17, 18.7, 19, 20,
28 1, 2, 3.3, 4.3333, 5.5, 6.23, 7, 8.63, 9, 10.6,
29 21, 22.12, 23.55, 24.76, 25, 26, 27.34, 28.765, 29, 30,
30 31.111, 32.322
33 check_vect ();
35 float ret = condition_reduction (a, 16.7);
37 if (ret != (float)10.6)
38 abort ();
40 return 0;
43 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" { xfail { ! vect_max_reduc } } } } */
44 /* { dg-final { scan-tree-dump-not "condition expression based on integer induction." "vect" } } */