[PATCH] D120639: [RISCV] Pass -mno-relax to assembler when -fno-integrated-as specified
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 25 23:47:05 PDT 2022
MaskRay added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:764
CmdArgs.push_back(MArchName.data());
+ if (!Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax))
+ CmdArgs.push_back("-mno-relax");
----------------
Avoid using the error-prone default argument true.
================
Comment at: clang/test/Driver/riscv-gnutools.c:44
+// Check -mno-relax is passed when -fno-integrated-as specified
+// RUN: %clang -target riscv64 --gcc-toolchain=%S/Inputs/basic_riscv64_tree -mno-relax -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64-NO-RELAX %s
----------------
I don't think repeating this for 64-bit adds value.
It may be more useful to change this to test `-mno-relax -mrelax` instead.
`-target riscv64` should be `--target=riscv64-unknown-elf`, matching the triple name in %S/Inputs/basic_riscv64_tree .
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120639/new/
https://reviews.llvm.org/D120639
More information about the cfe-commits
mailing list