view gcc/testsuite/c-c++-common/gomp/atomic-10.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* PR middle-end/28046 */
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
/* { dg-require-effective-target cas_int } */

int a[3], b;
struct C { int x; int y; } c;

int bar (void), *baz (void);

void
foo (void)
{
#pragma omp atomic
  a[2] += bar ();
#pragma omp atomic
  b += bar ();
#pragma omp atomic
  c.y += bar ();
#pragma omp atomic
  *baz () += bar ();
}

/* { dg-final { scan-tree-dump-times "__atomic_fetch_add" 4 "ompexp" } } */