diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-04-11 09:13:11 +0000 |
---|---|---|
committer | <> | 2014-04-23 12:05:38 +0000 |
commit | 6af3fdec2262dd94954acc5e426ef71cbd4521d3 (patch) | |
tree | 9be02de9a80f7935892a2d03741adee44723e65d /gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c | |
parent | 19be2b4342ac32e9edc78ce6fed8f61b63ae98d1 (diff) | |
download | gcc-tarball-6af3fdec2262dd94954acc5e426ef71cbd4521d3.tar.gz |
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.7.3.tar.bz2.gcc-4.7.3
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c b/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c new file mode 100644 index 0000000000..a35d90b3a0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c @@ -0,0 +1,43 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 128 +#define TYPE int +#define RESULT 755918 + +__attribute__ ((noinline)) TYPE fun2 (TYPE *x, TYPE *y, unsigned int n) +{ + int i, j; + TYPE dot = 14; + + for (i = 0; i < n / 2; i++) + for (j = 0; j < 2; j++) + dot += *(x++) * *(y++); + + return dot; +} + +int main (void) +{ + TYPE a[N], b[N], dot; + int i; + + check_vect (); + + for (i = 0; i < N; i++) + { + a[i] = i; + b[i] = i+8; + } + + dot = fun2 (a, b, N); + if (dot != RESULT) + abort(); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_int_mult && {! vect_no_align } } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ |