return Args.MakeArgString(OutputFilename);
}
- return Args.MakeArgString(std::string(getBaseInputStem(Args, Inputs)) + ".d");
+ return Args.MakeArgString(Twine(getBaseInputStem(Args, Inputs)) + ".d");
}
// Begin ClangAs
--- /dev/null
+// RUN: %clang -M -MM %s 2>&1 | FileCheck /dev/null --implicit-check-not=warning
+
+// RUN: mkdir -p %t.dir
+// RUN: rm -f %t.dir/test.d
+// RUN: %clang -fsyntax-only -MD %s -o %t.dir/test.i
+// RUN: test -f %t.dir/test.d
+
+/// If the output file name does not have a suffix, just append `.d`.
+// RUN: rm -f %t.dir/test.d
+// RUN: %clang -fsyntax-only -MD %s -o %t.dir/test
+// RUN: test -f %t.dir/test.d
+
+#warning "-M and -MM suppresses preprocessing, thus this warning shouldn't show up"
+int main(void)
+{
+ return 0;
+}
+++ /dev/null
-// 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
-
-// RUN: %clang -MMD -MD %s 2> %t || true
-// RUN: grep "warning" %t
-
-#warning "This warning shouldn't show up with -M and -MM"
-int main (void)
-{
- return 0;
-}
+++ /dev/null
-// REQUIRES: shell
-// RUN: mkdir -p %t/out.dir
-// RUN: cat %s > %t/out.dir/test.c
-// RUN: %clang -E -MMD %s -o %t/out.dir/test
-// RUN: test ! -f %out.d
-// RUN: test -f %t/out.dir/test.d
-// RUN: rm -rf %t/out.dir/test.d %t/out.dir/ out.d
-int main (void)
-{
- return 0;
-}