Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/vect-reduc-6.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-require-effective-target vect_float } */ | |
2 | |
3 #include <stdarg.h> | |
4 #include "tree-vect.h" | |
5 | |
6 #define N 16 | |
7 #define DIFF 242 | |
8 | |
9 __attribute__ ((noinline)) | |
10 int main1 (float x, float max_result) | |
11 { | |
12 int i; | |
13 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; | |
14 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; | |
15 float diff = 2; | |
16 float max = x; | |
17 float min = 10; | |
18 | |
19 for (i = 0; i < N; i++) { | |
20 diff += (b[i] - c[i]); | |
21 } | |
22 | |
23 for (i = 0; i < N; i++) { | |
24 max = max < c[i] ? c[i] : max; | |
25 } | |
26 | |
27 for (i = 0; i < N; i++) { | |
28 min = min > c[i] ? c[i] : min; | |
29 } | |
30 | |
31 /* check results: */ | |
32 if (diff != DIFF) | |
33 abort (); | |
34 if (max != max_result) | |
35 abort (); | |
36 if (min != 0) | |
37 abort (); | |
38 | |
39 return 0; | |
40 } | |
41 | |
42 int main (void) | |
43 { | |
44 check_vect (); | |
45 | |
46 main1 (100 ,100); | |
47 main1 (0, 15); | |
48 return 0; | |
49 } | |
50 | |
51 /* need -ffast-math to vectorizer these loops. */ | |
52 /* ARM NEON passes -ffast-math to these tests, so expect this to fail. */ | |
53 /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail arm_neon_ok } } } */ |