[PATCH] D74847: [CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V

Luís Marques via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 20 07:44:40 PST 2020


luismarques added a comment.

In D74847#1883028 <https://reviews.llvm.org/D74847#1883028>, @efriedma wrote:

> I'm not really a big fan of running tests with the host target triple, anyway; it seems to create work with almost no benefit.  I'd be happy to just run the test with one target that has native atomics, and one target that doesn't.  (The relevant code is all target-independent, aside from the atomic widths, so we aren't really gaining anything by testing more targets.)


That sounds fine to me. I might need to rewrite the tests with two different prefixes though (e.g. `NATIVE-` vs `LIBCALL-`), since I can't see how to mix substitution blocks with regex alternatives. For instance, we have this:

  // CHECK: %[[load:.*]] = {{load atomic i8, i8\* @b seq_cst|}}

You need to add an alternative for an `__atomic_load` libcall instead of the `load atomic`, but then the "assignment" to `%atomic-temp` moves to the right, as an out argument, so you'd need the variable capture to move to inside the regex, which I don't think is supported.
Is that OK, using different prefixes? Arguably that's a better test anyway, since you can then check your expectation that certain targets triples match certain alternative matches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74847





More information about the cfe-commits mailing list