summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr46032-2.c
blob: d769597ab9822d28fd379daf7a6f4b7d93b05687 (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
/* { dg-do compile } */
/* { dg-require-effective-target fopenmp } */
/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */

#define N 2

int
foo (void)
{
  int a[N], b[N], c[N];
  int *ap = &a[0];
  int *bp = &b[0];
  int *cp = &c[0];

#pragma omp parallel for
  for (unsigned int idx = 0; idx < N; idx++)
    {
      ap[idx] = 1;
      bp[idx] = 2;
      cp[idx] = ap[idx];
    }

  return *cp;
}

/* { dg-final { scan-tree-dump-times "\\] = 1;" 2 "optimized" } } */
/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 0 "optimized" } } */
/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */