| 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 128 |
| 8 |
|
| 9 |
__attribute__ ((noinline)) |
| 10 |
int main1 () |
| 11 |
{ |
| 12 |
union { |
| 13 |
unsigned char a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); |
| 14 |
unsigned char b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); |
| 15 |
} s; |
| 16 |
int i; |
| 17 |
|
| 18 |
/* Initialization. */ |
| 19 |
for (i = 0; i < N; i++) |
| 20 |
{ |
| 21 |
s.b[i] = i; |
| 22 |
} |
| 23 |
|
| 24 |
for (i = 0; i < N; i++) |
| 25 |
{ |
| 26 |
s.a[i] = s.b[i] + 1; |
| 27 |
} |
| 28 |
|
| 29 |
/* check results: */ |
| 30 |
#pragma GCC novector |
| 31 |
for (i = 0; i < N; i++) |
| 32 |
{ |
| 33 |
if (s.a[i] != i + 1) |
| 34 |
abort (); |
| 35 |
} |
| 36 |
|
| 37 |
return 0; |
| 38 |
} |
| 39 |
|
| 40 |
int main (void) |
| 41 |
{ |
| 42 |
check_vect (); |
| 43 |
|
| 44 |
return main1 (); |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail { ia64-*-* sparc*-*-* } } } } */ |
| 49 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |