[PATCH] D129824: [RISCV] Set triple based on -march flag which can be deduced in more generic way

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 18:45:48 PDT 2022


jrtc27 added inline comments.


================
Comment at: clang/test/Driver/riscv-arch.c:410
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
+// RUN: %clang --target=riscv32-unknown-elf -mcpu=sifive-s21 -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
----------------
This one maybe makes sense to allow, though gets murky once you have cores that support writable XLEN as then the same CPU exists for both RV32 and RV64 (like how you can ask for say haswell i386 and x86_64) so I'm not entirely sure...


================
Comment at: clang/test/Driver/riscv-arch.c:414
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
+// RUN: %clang --target=riscv32-unknown-elf -mabi=lp64 -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
----------------
IMO this kind of thing should remain an error, you're asking for an ABI that doesn't exist for the requested architecture


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

https://reviews.llvm.org/D129824



More information about the cfe-commits mailing list