aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-15.c
blob: 5e669fa3543d8d8491b5fcddc4dc6c00e12b91b7 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */

int x = 6;

int
main ()
{
  int v;
  #pragma omp atomic
    x = x * 7 + 6;	/* { dg-error "expected|invalid form of" } */
  #pragma omp atomic
    x = x * 7 ^ 6;	/* { dg-error "expected|invalid form of" } */
  #pragma omp atomic update
    x = x - 8 + 6;	/* { dg-error "expected|invalid form of" } */
  #pragma omp atomic
    x = x ^ 7 | 2;	/* { dg-error "expected|invalid form of" } */
  #pragma omp atomic
    x = x / 7 * 2;	/* { dg-error "expected|invalid form of" } */
  #pragma omp atomic
    x = x / 7 / 2;	/* { dg-error "expected|invalid form of" } */
  #pragma omp atomic capture
    { v = x; x = x * 7 + 6; }	/* { dg-error "expected" "" { target c++ } } */
  #pragma omp atomic capture
    { v = x; x = x * 7 ^ 6; }	/* { dg-error "expected" "" { target c++ } } */
  #pragma omp atomic capture
    { v = x; x = x - 8 + 6; }	/* { dg-error "expected" "" { target c++ } } */
  #pragma omp atomic capture
    { v = x; x = x ^ 7 | 2; }	/* { dg-error "expected" "" { target c++ } } */
  #pragma omp atomic capture
    { v = x; x = x / 7 * 2; }	/* { dg-error "expected" "" { target c++ } } */
  #pragma omp atomic capture
    { v = x; x = x / 7 / 2; }	/* { dg-error "expected" "" { target c++ } } */
  #pragma omp atomic capture
    { x = x * 7 + 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
  #pragma omp atomic capture
    { x = x * 7 ^ 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
  #pragma omp atomic capture
    { x = x - 8 + 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
  #pragma omp atomic capture
    { x = x ^ 7 | 2; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
  (void) v;
  return 0;
}