// when we are only generating a dependency file.
Arg *OutputOpt = Args.getLastArg(options::OPT_o);
if (OutputOpt && Output.getType() != types::TY_Dependencies) {
- DepTarget = A->getValue(Args);
+ DepTarget = OutputOpt->getValue(Args);
} else {
// Otherwise derive from the base input.
//
// rdar://6533411
// RUN: clang -MD -MF %t.d -c -x c -o %t.o /dev/null &&
-// RUN: grep '.*dependency-gen.c.out.tmp.o:' %t.d
+// RUN: grep '.*dependency-gen.c.out.tmp.o:' %t.d &&
// RUN: grep '/dev/null' %t.d &&
// RUN: clang -M -x c /dev/null -o %t.deps &&