| 1 |
/* { dg-do run { target vect_cmdline_needed } } */ |
| 2 |
/* { dg-options "-O2 -ftree-vectorize -fwrapv -fdump-tree-vect-details -fvect-cost-model=dynamic" } */ |
| 3 |
/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */ |
| 4 |
/* The IBM Z backend sets the min-vect-loop-bound param to 2 to avoid |
| 5 |
awkward epilogue code generation in some cases. This line needs to |
| 6 |
be removed after finding an alternate way to fix this. */ |
| 7 |
/* { dg-additional-options "--param min-vect-loop-bound=0" { target { s390*-*-* } } } */ |
| 8 |
|
| 9 |
#include <stdlib.h> |
| 10 |
|
| 11 |
#define N 16 |
| 12 |
|
| 13 |
char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 14 |
char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 15 |
|
| 16 |
int main () |
| 17 |
{ |
| 18 |
int i; |
| 19 |
char ia[N]; |
| 20 |
|
| 21 |
for (i = 0; i < N; i++) |
| 22 |
{ |
| 23 |
ia[i] = ib[i] + ic[i]; |
| 24 |
} |
| 25 |
|
| 26 |
/* check results: */ |
| 27 |
for (i = 0; i < N; i++) |
| 28 |
{ |
| 29 |
if (ia[i] != ib[i] + ic[i]) |
| 30 |
abort (); |
| 31 |
} |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */ |