From: Daniel Dunbar Date: Mon, 30 Mar 2009 17:59:58 +0000 (+0000) Subject: Fix -MD with no -MT when -o is specified (and fix test case). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46562b9122417bf6f70626f69bd79b8f5a4adac9;p=clang Fix -MD with no -MT when -o is specified (and fix test case). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68042 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 3e8ccb3de3..e315a2f20e 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -246,7 +246,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // 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. // diff --git a/test/Frontend/dependency-gen.c b/test/Frontend/dependency-gen.c index c0b7904425..456ce947f0 100644 --- a/test/Frontend/dependency-gen.c +++ b/test/Frontend/dependency-gen.c @@ -1,6 +1,6 @@ // 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 &&