Index: Basic/Targets.cpp =================================================================== --- Basic/Targets.cpp +++ Basic/Targets.cpp @@ -8534,6 +8534,13 @@ } bool validateTarget(DiagnosticsEngine &Diags) const override { + if ((getTriple().getArch() == llvm::Triple::mips64 || + getTriple().getArch() == llvm::Triple::mips64el) && + IsMicromips && CPU == "mips64r6") { + Diags.Report(diag::err_target_unsupported_cpu_for_micromips) << CPU; + return false; + } + // FIXME: It's valid to use O32 on a 64-bit CPU but the backend can't handle // this yet. It's better to fail here than on the backend assertion. if (processorSupportsGPR64() && ABI == "o32") { Index: clang/Basic/DiagnosticCommonKinds.td =================================================================== --- clang/Basic/DiagnosticCommonKinds.td +++ clang/Basic/DiagnosticCommonKinds.td @@ -185,6 +185,7 @@ def err_target_unknown_triple : Error< "unknown target triple '%0', please use -triple or -arch">; def err_target_unknown_cpu : Error<"unknown target CPU '%0'">; +def err_target_unsupported_cpu_for_micromips : Error<"micromips is not supported for target CPU '%0'">; def err_target_unknown_abi : Error<"unknown target ABI '%0'">; def err_target_unsupported_abi : Error<"ABI '%0' is not supported on CPU '%1'">; def err_target_unsupported_abi_for_triple : Error<