diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c b/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c new file mode 100644 index 0000000000..4e3dcbd322 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-additional-options "-O3 -fopt-info-vec-optimized" } */ + +/* PR other/33426 */ +/* Testing whether #pragma ivdep is working. */ + +void foo(int n, int *a, int *b, int *c) { + int i; + i = 0; +#pragma GCC ivdep + while(i < n) + { + a[i] = b[i] + c[i]; + ++i; + } +} + +void bar(int n, int *a, int *b, int *c) { + int i; + i = 0; +#pragma GCC ivdep + do + { + a[i] = b[i] + c[i]; + ++i; + } + while(i < n); +} + + +/* { dg-message "loop vectorized" "" { target *-*-* } 0 } */ +/* { dg-bogus " version\[^\n\r]* alias" "" { target *-*-* } 0 } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ |