gcc/testsuite/gcc.dg/vect/vect-15.c
raw| 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 a[N]; |
| 14 | int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 15 | |
| 16 | /* Not vectorizable yet (reverse access and forward access). */ |
| 17 | for (i = N; i > 0; i--) |
| 18 | { |
| 19 | a[N-i] = b[i-1]; |
| 20 | } |
| 21 | |
| 22 | /* check results: */ |
| 23 | #pragma GCC novector |
| 24 | for (i = 0; i <N; i++) |
| 25 | { |
| 26 | if (a[i] != b[N-1-i]) |
| 27 | abort (); |
| 28 | } |
| 29 | |
| 30 | return 0; |
| 31 | } |
| 32 | |
| 33 | int main (void) |
| 34 | { |
| 35 | check_vect(); |
| 36 | |
| 37 | return main1 (); |
| 38 | } |
| 39 | |
| 40 | /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */ |
| 41 | /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |