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
6 /* PR other/33426 */
7 /* Testing whether #pragma ivdep is working. */
8
9 #include <vector>
10
11 template<class T, class T2>
Loop(T * b,T2 c)12 void Loop(T *b, T2 c) {
13 #pragma GCC ivdep
14 for (auto &i : *b) {
15 i *= *c;
16 }
17 }
18
foo(std::vector<int> * ar,int * b)19 void foo(std::vector<int> *ar, int *b) {
20 Loop<std::vector<int>, int*>(ar, b);
21 }
22
23 /* { dg-message "loop vectorized" "" { target *-*-* } 0 } */
24 /* FIXME: dg-bogus " version\[^\n\r]* alias" "" { target *-*-* } 0 */
25 /* { dg-prune-output " version\[^\n\r]* alignment" } */
26
27 /* { dg-final { scan-tree-dump-times "ANNOTATE_EXPR " 1 "original" } } */
28 /* { dg-final { scan-tree-dump-times "ANNOTATE " 1 "gimple" } } */
29