yamaguchi updated this revision to Diff 96273.
yamaguchi added a comment.

Add testcase.


https://reviews.llvm.org/D32341

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/m_and_mm.c


Index: test/Driver/m_and_mm.c
===================================================================
--- test/Driver/m_and_mm.c
+++ test/Driver/m_and_mm.c
@@ -1,3 +1,7 @@
 // RUN: %clang -### \
 // RUN:   -M -MM %s 2> %t
 // RUN: not grep '"-sys-header-deps"' %t
+
+// RUN: %clang -M -MM %s 2> %t
+// RUN: not grep "warning" %t
+#warning "This warning shouldn't shop up with -M and -MM"
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -980,6 +980,7 @@
         DepTarget = Args.MakeArgString(llvm::sys::path::filename(P));
       }
 
+      CmdArgs.push_back("-w");
       CmdArgs.push_back("-MT");
       SmallString<128> Quoted;
       QuoteTarget(DepTarget, Quoted);


Index: test/Driver/m_and_mm.c
===================================================================
--- test/Driver/m_and_mm.c
+++ test/Driver/m_and_mm.c
@@ -1,3 +1,7 @@
 // RUN: %clang -### \
 // RUN:   -M -MM %s 2> %t
 // RUN: not grep '"-sys-header-deps"' %t
+
+// RUN: %clang -M -MM %s 2> %t
+// RUN: not grep "warning" %t
+#warning "This warning shouldn't shop up with -M and -MM"
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -980,6 +980,7 @@
         DepTarget = Args.MakeArgString(llvm::sys::path::filename(P));
       }
 
+      CmdArgs.push_back("-w");
       CmdArgs.push_back("-MT");
       SmallString<128> Quoted;
       QuoteTarget(DepTarget, Quoted);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to