Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-reduc-4.c
blob46572544e92fc21ad7f0d9fef2d955f3bcdc9e2a
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-options "-O2 -ftree-vectorize -maltivec -fdump-tree-vect-stats -ftrapv" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
8 #define DIFF 242
10 int main1 (int x, int max_result)
12 int i;
13 int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
14 int c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
15 int diff = 2;
16 int max = x;
17 int min = 10;
19 for (i = 0; i < N; i++) {
20 diff += (b[i] - c[i]);
23 for (i = 0; i < N; i++) {
24 max = max < c[i] ? c[i] : max;
27 for (i = 0; i < N; i++) {
28 min = min > c[i] ? c[i] : min;
31 /* check results: */
32 if (diff != DIFF)
33 abort ();
34 if (max != max_result)
35 abort ();
36 if (min != 0)
37 abort ();
40 int main (void)
42 check_vect ();
44 return main1 (100, 100);
45 return main1 (0, 15);
48 /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
49 /* { dg-final { cleanup-tree-dump "vect" } } */