// some build systems. We don't try to be complete here because we don't
// care to encourage this usage model.
if (A->getOption().matches(options::OPT_Wp_COMMA) &&
- A->getNumValues() == 2 &&
(A->getValue(0) == StringRef("-MD") ||
A->getValue(0) == StringRef("-MMD"))) {
// Rewrite to -MD/-MMD along with -MF.
DAL->AddFlagArg(A, Opts->getOption(options::OPT_MD));
else
DAL->AddFlagArg(A, Opts->getOption(options::OPT_MMD));
- DAL->AddSeparateArg(A, Opts->getOption(options::OPT_MF),
- A->getValue(1));
+ if (A->getNumValues() == 2)
+ DAL->AddSeparateArg(A, Opts->getOption(options::OPT_MF),
+ A->getValue(1));
continue;
}
// CHECK: "-MT"
//
// PR4062
+
+// RUN: %clang --target i386-pc-linux-gnu -### \
+// RUN: -Wp,-MMD -fsyntax-only %s 2> %t
+// RUN: FileCheck -check-prefix MMD < %t %s
+
+// MMD: "-cc1"
+// MMD-NOT: -MMD
+// MMD: "-dependency-file" "Wp-args.d"