gcc/testsuite/gcc.target/i386/vect-double-1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-skip-if "" { *-*-* } { "-march=*" } { "-march=core2" } } */ |
| 3 | /* { dg-options "-O2 -ftree-vectorize -fno-tree-loop-distribute-patterns -mfpmath=sse -march=core2 -fdump-tree-vect-stats" } */ |
| 4 | /* { dg-add-options bind_pic_locally } */ |
| 5 | |
| 6 | extern void abort (void); |
| 7 | |
| 8 | #ifndef STATIC |
| 9 | #define STATIC |
| 10 | #endif |
| 11 | |
| 12 | #define N 16 |
| 13 | |
| 14 | double cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 15 | double ca[N]; |
| 16 | |
| 17 | STATIC void |
| 18 | __attribute__ ((noinline)) |
| 19 | sse2_test (void) |
| 20 | { |
| 21 | int i; |
| 22 | |
| 23 | for (i = 0; i < N; i++) |
| 24 | { |
| 25 | ca[i] = cb[i]; |
| 26 | } |
| 27 | |
| 28 | /* check results: */ |
| 29 | for (i = 0; i < N; i++) |
| 30 | { |
| 31 | if (ca[i] != cb[i]) |
| 32 | abort (); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /* { dg-final { scan-tree-dump-times "Vectorized loops: 1" 1 "vect" } } */ |