131
|
1 /* { dg-require-effective-target vect_float_strict } */
|
|
2 /* { dg-additional-options "-fno-fast-math" } */
|
111
|
3
|
|
4 #include <stdarg.h>
|
|
5 #include "tree-vect.h"
|
|
6
|
|
7 #define N 16
|
|
8 #define DIFF 242
|
|
9
|
|
10 __attribute__ ((noinline))
|
|
11 int main1 (float x, float max_result)
|
|
12 {
|
|
13 int i;
|
|
14 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
|
|
15 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
|
|
16 float diff = 2;
|
|
17 float max = x;
|
|
18 float min = 10;
|
|
19
|
|
20 for (i = 0; i < N; i++) {
|
|
21 diff += (b[i] - c[i]);
|
|
22 }
|
|
23
|
|
24 for (i = 0; i < N; i++) {
|
|
25 max = max < c[i] ? c[i] : max;
|
|
26 }
|
|
27
|
|
28 for (i = 0; i < N; i++) {
|
|
29 min = min > c[i] ? c[i] : min;
|
|
30 }
|
|
31
|
|
32 /* check results: */
|
|
33 if (diff != DIFF)
|
|
34 abort ();
|
|
35 if (max != max_result)
|
|
36 abort ();
|
|
37 if (min != 0)
|
|
38 abort ();
|
|
39
|
|
40 return 0;
|
|
41 }
|
|
42
|
|
43 int main (void)
|
|
44 {
|
|
45 check_vect ();
|
|
46
|
|
47 main1 (100 ,100);
|
|
48 main1 (0, 15);
|
|
49 return 0;
|
|
50 }
|
|
51
|
131
|
52 /* { dg-final { scan-tree-dump-times {using an in-order \(fold-left\) reduction} 1 "vect" } } */
|
|
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
|