SVE Intrinsics: Change return type of redirect_call to gcall.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / trapv-vect-reduc-4.c
blob24cf1f793c7f15911f7866260dd4e510c48adc1a
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-do compile } */
4 /* { dg-require-effective-target vect_int } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #define N 16
10 #define DIFF 242
12 int main1 (int x, int max_result)
14 int i;
15 int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
16 int c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
17 int diff = 2;
18 int max = x;
19 int min = 10;
21 for (i = 0; i < N; i++) {
22 diff += (b[i] - c[i]);
25 for (i = 0; i < N; i++) {
26 max = max < c[i] ? c[i] : max;
29 for (i = 0; i < N; i++) {
30 min = min > c[i] ? c[i] : min;
33 /* check results: */
34 if (diff != DIFF)
35 abort ();
36 if (max != max_result)
37 abort ();
38 if (min != 0)
39 abort ();
42 int main (void)
44 check_vect ();
46 main1 (100, 100);
47 main1 (0, 15);
48 return 0;
51 /* We can't handle the first loop with variable-length vectors and so
52 fall back to the fixed-length mininum instead. */
53 /* { dg-final { scan-tree-dump-times "Detected reduction\\." 3 "vect" { target { ! vect_multiple_sizes } xfail vect_variable_length } } } */
54 /* { dg-final { scan-tree-dump "Detected reduction\\." "vect" { target vect_multiple_sizes } } } */
55 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { ! vect_no_int_min_max } } } } */
56 /* { dg-final { scan-tree-dump-times {using an in-order \(fold-left\) reduction} 1 "vect" } } */