| 1 |
/* { dg-require-effective-target vect_condition } */ |
| 2 |
/* { dg-require-effective-target vect_int } */ |
| 3 |
|
| 4 |
#include "tree-vect.h" |
| 5 |
|
| 6 |
#define N 16 |
| 7 |
|
| 8 |
extern void abort (void); |
| 9 |
|
| 10 |
int A[N] = {36, 39, 42, 45, 43, 32, 21, 12, 23, 34, 45, 56, 67, 78, 81, 11}; |
| 11 |
int B[N] = {144,195,210,225,172,128,105,60, 92, 136,225,280,268,390,324,55}; |
| 12 |
|
| 13 |
__attribute__((noinline)) |
| 14 |
void foo () |
| 15 |
{ |
| 16 |
for (int i = 0; i < N; i++) |
| 17 |
{ |
| 18 |
int m = (A[i] & i) ? 5 : 4; |
| 19 |
A[i] = A[i] * m; |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
int main () |
| 24 |
{ |
| 25 |
|
| 26 |
check_vect (); |
| 27 |
foo (); |
| 28 |
/* check results: */ |
| 29 |
#pragma GCC novector |
| 30 |
for (int i = 0; i < N; i++) |
| 31 |
if (A[i] != B[i]) |
| 32 |
abort (); |
| 33 |
|
| 34 |
return 0; |
| 35 |
} |
| 36 |
|
| 37 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |