[CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V
authorLuís Marques <luismarques@lowrisc.org>
Fri, 21 Feb 2020 19:26:09 +0000 (19:26 +0000)
committerLuís Marques <luismarques@lowrisc.org>
Fri, 21 Feb 2020 19:29:57 +0000 (19:29 +0000)
commit0781e93a6eaa71ec5d87be3bbeeeed053067f7ee
tree96f63c62f9bd6c31c764d8d35c5ecd2bad2f3ce3
parent266959c0f72ff359a60fe43da0cf336604611029
[CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V

By default the RISC-V target doesn't have the atomics standard extension
enabled. The first RUN line in `clang/test/CodeGen/atomic_ops.c` didn't
specify a target triple, which meant that on RISC-V Linux hosts it would
target RISC-V, but because it used clang cc1 we didn't get the toolchain
driver functionality to automatically turn on the extensions implied by
the target triple (riscv64-linux includes atomics). This would cause the
test to fail on RISC-V hosts.

This patch changes the test to have RUN lines for two explicit targets,
one with native atomics and one without. To work around FileCheck
limitations and more accurately match the output, some tests now have
separate prefixes for the two cases.

Reviewers: jyknight, eli.friedman, lenary, efriedma
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D74847
clang/test/CodeGen/atomic_ops.c