PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr65947-8.c
blobf0f1ac29699fabb01582b9ee10705e17ee3b802d
1 /* { dg-require-effective-target vect_condition } */
3 #include "tree-vect.h"
5 extern void abort (void) __attribute__ ((noreturn));
7 #define N 27
9 /* Condition reduction with multiple types in the comparison. Will fail to
10 vectorize. */
12 int
13 condition_reduction (char *a, int min_v)
15 int last = N + 65;
17 for (int i = 0; i < N; i++)
18 if (a[i] < min_v)
19 last = a[i];
21 return last;
25 int
26 main (void)
28 char a[N] = {
29 1, 28, 3, 48, 5, 68, 7, -88, 89, 180,
30 121, 122, -123, 124, 12, -12, 12, 67, 84, 122,
31 67, 55, 112, 22, 45, 23, 111
34 check_vect ();
36 int ret = condition_reduction (a, 16);
38 if (ret != 12)
39 abort ();
41 return 0;
44 /* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */
45 /* { dg-final { scan-tree-dump "multiple types in double reduction or condition reduction" "vect" } } */