| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
#include "tree-vect.h" |
| 6 |
|
| 7 |
#define N 16 |
| 8 |
|
| 9 |
__attribute__ ((noinline)) |
| 10 |
int main1 () |
| 11 |
{ |
| 12 |
int i; |
| 13 |
int ia[N]; |
| 14 |
int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 15 |
int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 16 |
short sa[N]; |
| 17 |
short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 18 |
short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 19 |
|
| 20 |
/* Multiple types with different nunits in vector. */ |
| 21 |
for (i = 0; i < N; i++) |
| 22 |
{ |
| 23 |
ia[i] = ib[i] + ic[i]; |
| 24 |
sa[i] = sb[i] + sc[i]; |
| 25 |
} |
| 26 |
|
| 27 |
/* check results: */ |
| 28 |
#pragma GCC novector |
| 29 |
for (i = 0; i < N; i++) |
| 30 |
{ |
| 31 |
if (ia[i] != ib[i] + ic[i] || sa[i] != sb[i] + sc[i]) |
| 32 |
abort (); |
| 33 |
} |
| 34 |
|
| 35 |
return 0; |
| 36 |
} |
| 37 |
|
| 38 |
int main (void) |
| 39 |
{ |
| 40 |
check_vect (); |
| 41 |
|
| 42 |
return main1 (); |
| 43 |
} |
| 44 |
|
| 45 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 46 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |