summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/atomic-2.c
blob: 720ec9e8ba0dc1690e733af9a451f42f3a0a1505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */

float x, y;

void f1(void)
{
  #pragma omp atomic
    x++;
  #pragma omp atomic
    x--;
  #pragma omp atomic
    ++x;
  #pragma omp atomic
    --x;
  #pragma omp atomic
    x += 1;
  #pragma omp atomic
    x -= y;
  #pragma omp atomic
    x *= 3;
  #pragma omp atomic
    x /= 3;
}