diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c new file mode 100644 index 000000000..5676b2470 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c @@ -0,0 +1,40 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "../../tree-vect.h" + +#define N 16 +struct test { + char ca[N]; +}; + +extern struct test s; + +__attribute__ ((noinline)) +int main1 () +{ + int i; + + for (i = 0; i < N; i++) + { + s.ca[i] = 5; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (s.ca[i] != 5) + abort (); + } + + return 0; +} + +int main (void) +{ + return main1 (); +} + +/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ |