diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -109,6 +109,9 @@ case llvm::Triple::x86_64: getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false); break; + case llvm::Triple::riscv64: + getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false); + break; } // TODO: Add target specific flags, ABI, mtune option etc. diff --git a/flang/test/Driver/target-features.f90 b/flang/test/Driver/target-features.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Driver/target-features.f90 @@ -0,0 +1,4 @@ +! RUN: %flang --target=riscv64-linux-gnu --target=riscv64 -c %s -### 2>&1 \ +! RUN: | FileCheck %s -check-prefix=CHECK-RV64 + +! CHECK-RV64: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+c" "-target-feature" "-e" "-target-feature" "-f" "-target-feature" "-d" "-target-feature" "-h" "-target-feature" "-zihintpause" "-target-feature" "-zfhmin" "-target-feature" "-zfh" "-target-feature" "-zfinx" "-target-feature" "-zdinx" "-target-feature" "-zhinxmin" "-target-feature" "-zhinx" "-target-feature" "-zba" "-target-feature" "-zbb" "-target-feature" "-zbc" "-target-feature" "-zbs" "-target-feature" "-zbkb" "-target-feature" "-zbkc" "-target-feature" "-zbkx" "-target-feature" "-zknd" "-target-feature" "-zkne" "-target-feature" "-zknh" "-target-feature" "-zksed" "-target-feature" "-zksh" "-target-feature" "-zkr" "-target-feature" "-zkn" "-target-feature" "-zks" "-target-feature" "-zkt" "-target-feature" "-zk" "-target-feature" "-zmmul" "-target-feature" "-v" "-target-feature" "-zvl32b" "-target-feature" "-zvl64b" "-target-feature" "-zvl128b" "-target-feature" "-zvl256b" "-target-feature" "-zvl512b" "-target-feature" "-zvl1024b" "-target-feature" "-zvl2048b" "-target-feature" "-zvl4096b" "-target-feature" "-zvl8192b" "-target-feature" "-zvl16384b" "-target-feature" "-zvl32768b" "-target-feature" "-zvl65536b" "-target-feature" "-zve32x" "-target-feature" "-zve32f" "-target-feature" "-zve64x" "-target-feature" "-zve64f" "-target-feature" "-zve64d" "-target-feature" "-zicbom" "-target-feature" "-zicboz" "-target-feature" "-zicbop" "-target-feature" "-zicsr" "-target-feature" "-zifencei" "-target-feature" "-zawrs" "-target-feature" "-svnapot" "-target-feature" "-svpbmt" "-target-feature" "-svinval" "-target-feature" "-xtheadba" "-target-feature" "-xtheadbb" "-target-feature" "-xtheadbs" "-target-feature" "-xtheadcmo" "-target-feature" "-xtheadcondmov" "-target-feature" "-xtheadfmemidx" "-target-feature" "-xtheadmac" "-target-feature" "-xtheadmemidx" "-target-feature" "-xtheadmempair" "-target-feature" "-xtheadsync" "-target-feature" "-xtheadvdot" "-target-feature" "-xventanacondops" "-target-feature" "-experimental-zihintntl" "-target-feature" "-experimental-zca" "-target-feature" "-experimental-zcb" "-target-feature" "-experimental-zcd" "-target-feature" "-experimental-zcf" "-target-feature" "-experimental-zfa" "-target-feature" "-experimental-zvfh" "-target-feature" "-experimental-ztso" "-target-feature" "+relax" "-target-feature" "-save-restore"