| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target vect_int } */ |
| 3 |
/* { dg-require-effective-target vect_int_mult } */ |
| 4 |
/* { dg-additional-options "-std=c++11 -O3 -fopt-info-vec-optimized -fdump-tree-original -fdump-tree-gimple" } */ |
| 5 |
/* { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } */ |
| 6 |
|
| 7 |
/* PR other/33426 */ |
| 8 |
/* Testing whether #pragma ivdep is working. */ |
| 9 |
|
| 10 |
#include <vector> |
| 11 |
|
| 12 |
template<class T, class T2> |
| 13 |
void Loop(T *b, T2 c) { |
| 14 |
#pragma GCC ivdep |
| 15 |
for (auto &i : *b) { |
| 16 |
i *= *c; |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
void foo(std::vector<int> *ar, int *b) { |
| 21 |
Loop<std::vector<int>, int*>(ar, b); |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-message "loop vectorized" "" { target *-*-* } 0 } */ |
| 25 |
/* FIXME: dg-bogus " version\[^\n\r]* alias" "" { target *-*-* } 0 */ |
| 26 |
/* { dg-prune-output " version\[^\n\r]* alignment" } */ |
| 27 |
|
| 28 |
/* { dg-final { scan-tree-dump-times "ANNOTATE_EXPR " 1 "original" } } */ |
| 29 |
/* { dg-final { scan-tree-dump-times "ANNOTATE " 1 "gimple" } } */ |