summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/atomic-9.c
blob: 128e9df5e4aef5dbdc4ef4603884308554a05593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-gimple" } */

volatile int *bar(void);

void f1(void)
{
  #pragma omp atomic
    *bar() += 1;
}

/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */