gcc/testsuite/gcc.dg/vect/vect-2.c
raw| 1 | /* { dg-require-effective-target vect_int } */ |
| 2 | /* { dg-add-options bind_pic_locally } */ |
| 3 | /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */ |
| 4 | |
| 5 | #include <stdarg.h> |
| 6 | #include "tree-vect.h" |
| 7 | |
| 8 | #define N 16 |
| 9 | |
| 10 | char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 11 | char ca[N] = {}; |
| 12 | |
| 13 | __attribute__ ((noinline)) |
| 14 | int main1 () |
| 15 | { |
| 16 | int i; |
| 17 | |
| 18 | for (i = 0; i < N; i++) |
| 19 | { |
| 20 | ca[i] = cb[i]; |
| 21 | } |
| 22 | |
| 23 | /* check results: */ |
| 24 | #pragma GCC novector |
| 25 | for (i = 0; i < N; i++) |
| 26 | { |
| 27 | if (ca[i] != cb[i]) |
| 28 | abort (); |
| 29 | } |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | int main (void) |
| 35 | { |
| 36 | check_vect (); |
| 37 | |
| 38 | return main1 (); |
| 39 | } |
| 40 | |
| 41 | /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 42 | /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ |
| 43 | /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |