view gcc/testsuite/c-c++-common/gomp/atomic-15.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { 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;
}