]> granicus.if.org Git - clang/commitdiff
Fix -MD with no -MT when -o is specified (and fix test case).
authorDaniel Dunbar <daniel@zuster.org>
Mon, 30 Mar 2009 17:59:58 +0000 (17:59 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 30 Mar 2009 17:59:58 +0000 (17:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68042 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Frontend/dependency-gen.c

index 3e8ccb3de3d93c920eed35c403e83b1f4753419b..e315a2f20ecd4ff2dc37881c5efbf13f7cad1204 100644 (file)
@@ -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.
           //
index c0b79044251ad2fe191aa129ec8bcdaebb310c85..456ce947f0916efb8bae8f7b0ca38f337f3515ce 100644 (file)
@@ -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 &&