aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c
blob: 4e3dcbd322b31645d4c1a4b49aadab497cc16254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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" } } */