1  /* { dg-do compile } */
       2  
       3  int x;
       4  double d, g;
       5  
       6  void
       7  foo (int y, double e, long double f)
       8  {
       9    double v;
      10    int r, r2 = 0;
      11    #pragma omp atomic capture compare
      12    v = if (d == e) { d = f; };	/* { dg-error "expected expression" } */
      13    #pragma omp atomic compare
      14    if;				/* { dg-error "expected '\\\(' before ';' token" } */
      15    #pragma omp atomic compare
      16    if (d >= e) { d = e; }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" } */
      17    #pragma omp atomic compare
      18    if (d <= e) { d = e; }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" } */
      19    #pragma omp atomic compare
      20    if (d != e) { d = e; }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" } */
      21    #pragma omp atomic compare
      22    if (d + e) { d = e; }		/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" } */
      23    #pragma omp atomic capture compare
      24    { r = d >= e; if (r) { d = f; } }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" "" { target c } } */
      25    #pragma omp atomic capture compare	/* { dg-error "invalid form of '#pragma omp atomic' before 'd'" "" { target c++ } .-1 } */
      26    { r = d <= e; if (r) { d = f; } }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" "" { target c } } */
      27    #pragma omp atomic capture compare	/* { dg-error "invalid form of '#pragma omp atomic' before 'd'" "" { target c++ } .-1 } */
      28    { r = d > e; if (r) { d = f; } }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" "" { target c } } */
      29    #pragma omp atomic capture compare	/* { dg-error "invalid form of '#pragma omp atomic' before 'd'" "" { target c++ } .-1 } */
      30    { r = d < e; if (r) { d = f; } }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" "" { target c } } */
      31    #pragma omp atomic capture compare	/* { dg-error "invalid form of '#pragma omp atomic' before 'd'" "" { target c++ } .-1 } */
      32    { r = d != e; if (r) { d = f; } }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" "" { target c } } */
      33    #pragma omp atomic capture compare	/* { dg-error "invalid form of '#pragma omp atomic' before 'd'" "" { target c++ } .-1 } */
      34    { r = d + e; if (r) { d = f; } }	/* { dg-error "expected '==', '<' or '>' comparison in 'if' condition" "" { target c } } */
      35    #pragma omp atomic capture compare	/* { dg-error "invalid form of '#pragma omp atomic' before 'd'" "" { target c++ } .-1 } */
      36    { r = d == e; if (r2) { d = f; } }	/* { dg-error "invalid form of '#pragma omp atomic compare' before '\{' token" } */
      37    #pragma omp atomic capture compare
      38    if (d > e) { d = e; }			/* { dg-error "expected '==' comparison in 'if' condition" } */
      39    #pragma omp atomic capture compare
      40    if (d < e) { d = e; }			/* { dg-error "expected '==' comparison in 'if' condition" } */
      41    #pragma omp atomic compare
      42    if (d < e) d = e;			/* { dg-error "expected '\{' before 'd'" } */
      43    #pragma omp atomic compare
      44    if (d == e) d = e + 1.0;		/* { dg-error "expected '\{' before 'd'" } */
      45    #pragma omp atomic compare
      46    if (d < e) { d += e; }		/* { dg-error "expected '=' before '\\\+=' token" } */
      47    #pragma omp atomic compare
      48    if (d < e) { d = e };			/* { dg-error "expected ';' before '\}' token" } */
      49    #pragma omp atomic compare
      50    if (d < e) { d = e; e = 1.0; }	/* { dg-error "expected '\}' before 'e'" } */
      51    #pragma omp atomic compare
      52    if (e == d) { d = f; };		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      53    #pragma omp atomic compare
      54    if (e == d) { g = f; };		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      55    #pragma omp atomic compare
      56    if (d < e) { g = e; };		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      57    #pragma omp atomic compare
      58    if (d > e) { g = e; };		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      59    #pragma omp atomic compare
      60    if (d < e) { d = g; };		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      61    #pragma omp atomic compare
      62    if (d > e) { d = g; };		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      63    #pragma omp atomic compare
      64    if (d == e) { d = f; } else ;		/* { dg-error "unexpected 'else'" } */
      65    #pragma omp atomic compare capture
      66    { if (d == e) { d = f; } else { v = d; } v = d; }		/* { dg-error "unexpected 'else'" } */
      67    #pragma omp atomic compare
      68    if (d < e) { d = e; } else { v = d; }	/* { dg-error "unexpected 'else'" } */
      69    #pragma omp atomic compare capture
      70    if (d == e) { d = f; } else v = d;	/* { dg-error "expected '\{' before 'v'" } */
      71    #pragma omp atomic compare capture
      72    if (d == e) { d = f; } else { v += d;	}	/* { dg-error "expected '=' before '\\\+=' token" } */
      73    #pragma omp atomic compare capture
      74    if (d == e) { d = f; } else { v = e; }	/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" } */
      75    #pragma omp atomic compare capture
      76    if (d == e) { d = f; } else { v = d };	/* { dg-error "expected ';' before '\}' token" } */
      77    #pragma omp atomic compare capture
      78    if (d == e) { d = f; };		/* { dg-error "expected 'else' before ';' token" } */
      79    #pragma omp atomic compare
      80    x++;					/* { dg-error "invalid form of 'pragma omp atomic compare'" } */
      81    #pragma omp atomic compare
      82    x--;					/* { dg-error "invalid form of 'pragma omp atomic compare'" } */
      83    #pragma omp atomic compare
      84    ++x;					/* { dg-error "invalid form of 'pragma omp atomic compare'" } */
      85    #pragma omp atomic compare
      86    --x;					/* { dg-error "invalid form of 'pragma omp atomic compare'" } */
      87    #pragma omp atomic compare
      88    x += 3;				/* { dg-error "expected '=' before '\\\+=' token" } */
      89    #pragma omp atomic compare
      90    x -= 5;				/* { dg-error "expected '=' before '-=' token" } */
      91    #pragma omp atomic compare
      92    x *= 2;				/* { dg-error "expected '=' before '\\\*=' token" } */
      93    #pragma omp atomic compare
      94    x |= 5;				/* { dg-error "expected '=' before '\\\|=' token" } */
      95    #pragma omp atomic compare
      96    x &= ~5;				/* { dg-error "expected '=' before '\\\&=' token" } */
      97    #pragma omp atomic compare
      98    x ^= 5;				/* { dg-error "expected '=' before '\\\^=' token" } */
      99    #pragma omp atomic compare
     100    x = x + 3;				/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     101    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before '\\\+' token" "" { target c++ } .-1 } */
     102    x = x - 5;				/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     103    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before '-' token" "" { target c++ } .-1 } */
     104    x = 2 * x;				/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     105    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic' before numeric constant" "" { target c++ } .-1 } */
     106    x = 5 | x;				/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     107    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic' before numeric constant" "" { target c++ } .-1 } */
     108    x = x & ~5;				/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     109    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before '\\\&' token" "" { target c++ } .-1 } */
     110    x = x | 5;				/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     111    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before '\\\|' token" "" { target c++ } .-1 } */
     112    x = x >= 5 ? 5 : x;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     113    #pragma omp atomic compare		/* { dg-error "invalid operator for '#pragma omp atomic' before '>=' token" "" { target c++ } .-1 } */
     114    x = x <= 5 ? 5 : x;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     115    #pragma omp atomic compare		/* { dg-error "invalid operator for '#pragma omp atomic' before '<=' token" "" { target c++ } .-1 } */
     116    x = x != 5 ? 7 : x;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     117    #pragma omp atomic compare		/* { dg-error "invalid operator for '#pragma omp atomic' before '!=' token" "" { target c++ } .-1 } */
     118    x = 5 == x ? 7 : x;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     119    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic' before numeric constant" "" { target c++ } .-1 } */
     120    x = x == 5 ? x : 7;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     121    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" "" { target c++ } .-1 } */
     122    x = x == 5 ? 9 : 7;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     123    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" "" { target c++ } .-1 } */
     124    x = x > 5 ? 6 : x;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     125    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" "" { target c++ } .-1 } */
     126    x = x < 5 ? 6 : x;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     127    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" "" { target c++ } .-1 } */
     128    x = x > 5 ? x : 6;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     129    #pragma omp atomic compare		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" "" { target c++ } .-1 } */
     130    x = x < 5 ? x : 6;			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     131    #pragma omp atomic capture		/* { dg-error "invalid form of '#pragma omp atomic compare' before ';' token" "" { target c++ } .-1 } */
     132    r = x == 5;				/* { dg-error "invalid operator for '#pragma omp atomic' before '==' token" } */
     133    #pragma omp atomic capture compare
     134    r = x == 5;				/* { dg-error "expected '=' before '==' token" } */
     135    #pragma omp atomic capture compare	/* { dg-error "'#pragma omp atomic compare capture' with non-integral comparison result" } */
     136    { v = x == 5; if (v) { x = 6; } }
     137    #pragma omp atomic compare capture
     138    { r2 = x; x = y; }			/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" } */
     139    #pragma omp atomic compare capture
     140    { r2 = x; x = y == 7 ? 12 : y; }	/* { dg-error "invalid form of '#pragma omp atomic' before ';' token" "" { target c } } */
     141  					/* { dg-error "invalid form of '#pragma omp atomic' before 'y'" "" { target c++ } .-1 } */
     142  }