Args.AddLastArg(CmdArgs, options::OPT_fno_limit_debug_info);
Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
Args.AddLastArg(CmdArgs, options::OPT_faltivec);
+
+ // Report and error for -faltivec on anything other then PowerPC.
+ if (const Arg *A = Args.getLastArg(options::OPT_faltivec))
+ if (!(getToolChain().getTriple().getArch() == llvm::Triple::ppc ||
+ getToolChain().getTriple().getArch() == llvm::Triple::ppc64))
+ D.Diag(diag::err_drv_argument_only_allowed_with)
+ << A->getAsString(Args) << "ppc/ppc64";
+
if (getToolChain().SupportsProfiling())
Args.AddLastArg(CmdArgs, options::OPT_pg);
--- /dev/null
+// Check that we error when -faltivec is specified on a non-ppc platforms.
+
+// RUN: %clang -arch ppc -faltivec -fsyntax-only %s
+// RUN: %clang -arch ppc64 -faltivec -fsyntax-only %s
+
+// RUN: not %clang -arch i386 -faltivec -fsyntax-only %s
+// RUN: not %clang -arch x86_64 -faltivec -fsyntax-only %s
+// RUN: not %clang -arch armv6 -faltivec -fsyntax-only %s
+// RUN: not %clang -arch armv7 -faltivec -fsyntax-only %s
+// RUN: not %clang -arch mips -faltivec -fsyntax-only %s
+// RUN: not %clang -arch mips64 -faltivec -fsyntax-only %s
+// RUN: not %clang -arch sparc -faltivec -fsyntax-only %s