Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-reduc-6.c
blob6254297263346dfdcb087a3a8c593c89383c0656
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 #define DIFF 242
9 int main1 (float x, float max_result)
11 int i;
12 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
13 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
14 float diff = 2;
15 float max = x;
16 float min = 10;
18 for (i = 0; i < N; i++) {
19 diff += (b[i] - c[i]);
22 for (i = 0; i < N; i++) {
23 max = max < c[i] ? c[i] : max;
26 for (i = 0; i < N; i++) {
27 min = min > c[i] ? c[i] : min;
30 /* check results: */
31 if (diff != DIFF)
32 abort ();
33 if (max != max_result)
34 abort ();
35 if (min != 0)
36 abort ();
38 return 0;
41 int main (void)
43 check_vect ();
45 main1 (100 ,100);
46 main1 (0, 15);
47 return 0;
50 /* need -ffast-math to vectorizer these loops. */
51 /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
52 /* { dg-final { cleanup-tree-dump "vect" } } */