diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 69485c72410..2d80b479735 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -639,6 +639,11 @@ int main(int argc, char **argv) { CPUStr = getCPUStr(); FeaturesStr = getFeaturesStr(); Machine = GetTargetMachine(ModuleTriple, CPUStr, FeaturesStr, Options); + } else if (ModuleTriple.getArchName() != "unknown" && + ModuleTriple.getArchName() != "") { + errs() << argv[0] << ": unrecognized architecture '" + << ModuleTriple.getArchName() << "' provided.\n"; + return 1; } std::unique_ptr TM(Machine);