aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr54782.c
blob: 161b043c61b9395cb38915e07c89f17ad36bd782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
/* { dg-options "-O -ffast-math -ftree-parallelize-loops=2 -g" } */

struct S
{
  int n;
  float *a;
};

int
foo (struct S *s)
{
  float sum = 0;
  int i;
  for (i = 0; i < s->n; i++)
    sum += s->a[i];
  return sum;
}