template <class T>
T foo(T argc) {
+ T v = T();
T c = T();
T b = T();
T a = T();
{ a = a < b ? b : a; }
#pragma omp atomic compare
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic seq_cst
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare seq_cst
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture seq_cst
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare seq_cst capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture seq_cst
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare acq_rel
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture acq_rel
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare acq_rel capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture acq_rel
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare acquire
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture acquire
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare acquire capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture acquire
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic release
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare release
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture release
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare release capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture release
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic relaxed
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare relaxed
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture relaxed
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare relaxed capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture relaxed
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic hint(6)
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare hint(6)
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture hint(6)
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare hint(6) capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture hint(6)
+ { v = a == b; if (v) a = c; }
#endif
return T();
}
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic seq_cst
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read seq_cst
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture seq_cst
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare seq_cst capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture seq_cst
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acq_rel
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare acq_rel capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acq_rel
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read acquire
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acquire
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare acquire capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acquire
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic release
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture release
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare release capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture release
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic relaxed
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture relaxed
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare relaxed capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture relaxed
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic hint(6)
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read hint(6)
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture hint(6)
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare hint(6) capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture hint(6)
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK: int a = int();
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic seq_cst
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read seq_cst
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture seq_cst
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare seq_cst capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture seq_cst
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acq_rel
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare acq_rel capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acq_rel
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read acquire
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acquire
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare acquire capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture acquire
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic release
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture release
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare release capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture release
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic relaxed
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture relaxed
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare relaxed capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture relaxed
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic hint(6)
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read hint(6)
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture hint(6)
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a > b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare hint(6) capture
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a;
+// CHECK-51-NEXT: a = a < b ? b : a;
+// CHECK-51-NEXT: }
+// CHECK-51-NEXT: #pragma omp atomic compare capture hint(6)
+// CHECK-51-NEXT: {
+// CHECK-51-NEXT: v = a == b;
+// CHECK-51-NEXT: if (v)
+// CHECK-51-NEXT: a = c;
+// CHECK-51-NEXT: }
int main(int argc, char **argv) {
+ int v = 0;
int c = 0;
int b = 0;
int a = 0;
{ a = a < b ? b : a; }
#pragma omp atomic compare
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic seq_cst
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare seq_cst
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture seq_cst
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare seq_cst capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture seq_cst
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare acq_rel
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture acq_rel
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare acq_rel capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture acq_rel
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare acquire
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture acquire
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare acquire capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture acquire
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic release
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare release
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture release
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare release capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture release
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic relaxed
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare relaxed
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture relaxed
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare relaxed capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture relaxed
+ { v = a == b; if (v) a = c; }
#endif
#pragma omp atomic hint(6)
a++;
{ a = a < b ? b : a; }
#pragma omp atomic compare hint(6)
{ a = a == b ? c : a; }
+#pragma omp atomic compare capture hint(6)
+ { v = a; a = a > b ? b : a; }
+#pragma omp atomic compare hint(6) capture
+ { v = a; a = a < b ? b : a; }
+#pragma omp atomic compare capture hint(6)
+ { v = a == b; if (v) a = c; }
#endif
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic seq_cst
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read seq_cst
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture seq_cst
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare seq_cst capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture seq_cst
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture acq_rel
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare acq_rel capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture acq_rel
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read acquire
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture acquire
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare acquire capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture acquire
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic release
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture release
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare release capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture release
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic relaxed
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture relaxed
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare relaxed capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture relaxed
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// CHECK-NEXT: #pragma omp atomic hint(6)
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read hint(6)
// CHECK-51-NEXT: {
// CHECK-51-NEXT: a = a == b ? c : a;
// CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture hint(6)
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a > b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare hint(6) capture
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a;
+ // CHECK-51-NEXT: a = a < b ? b : a;
+ // CHECK-51-NEXT: }
+ // CHECK-51-NEXT: #pragma omp atomic compare capture hint(6)
+ // CHECK-51-NEXT: {
+ // CHECK-51-NEXT: v = a == b;
+ // CHECK-51-NEXT: if (v)
+ // CHECK-51-NEXT: a = c;
+ // CHECK-51-NEXT: }
// expect-note@+1 {{in instantiation of function template specialization 'foo<int>' requested here}}
return foo(a);
}