[PATCH] D116637: [Clang][Sema][OpenMP] Sema support for `atomic compare`

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 3 10:27:18 PST 2022


tianshilei1992 added a comment.

@ABataev @jdoerfert I got a question about writing the test. `atomic compare` is supported from 5.1. Basically we have three ways to guard those `atomic compare` code:

1. Use macro `_OPENMP`. This pretty much works with one exception: we don't set the macro for `-fopenmp-simd`. Then we cannot test `-fopenmp-simd`.
2. Use those `omp50-error` and `omp50-note` which are shown in this patch. `-fopenmp-simd` can be tested now. However, it doesn't work with `-emit-pch`. The compiler emits errors that `unexpected OpenMP clause 'compare' in directive '#pragma omp atomic'` for the lower version tests. If we add `-verify` to the `-emit-pch` line, then the pch will not be generated.
3. Put `atomic compare` tests in another file.

For now only the 3rd method could work, but I'm not sure if there are ways to work around the limitation in the first two approaches.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116637/new/

https://reviews.llvm.org/D116637



More information about the cfe-commits mailing list