diff options
author | Hans Wennborg <hans@hanshq.net> | 2017-01-18 00:16:39 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2017-01-18 00:16:39 +0000 |
commit | 8396c5b8ed81364fb003f9b50e3ebcc876e8bcd2 (patch) | |
tree | 2f2854642f5598d2f7547c584533e35b952af46d | |
parent | ed7385311285c3ba2a435066bfceb2aa28b95e6a (diff) |
Merging r292032:
------------------------------------------------------------------------
r292032 | yrnkrn | 2017-01-14 13:12:08 -0800 (Sat, 14 Jan 2017) | 4 lines
Fix PR31644 introduced by r287138 and add a regression test.
Thanks Dimitry Andric for the report and fix!
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292311 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Frontend/DependencyFile.cpp | 4 | ||||
-rw-r--r-- | test/Preprocessor/dependencies-and-pp.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index 059f116a3c..bd14c53e4d 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -447,9 +447,9 @@ void DFGImpl::OutputDependencyFile() { // Create phony targets if requested. if (PhonyTarget && !Files.empty()) { // Skip the first entry, this is always the input file itself. - for (StringRef File : Files) { + for (auto I = Files.begin() + 1, E = Files.end(); I != E; ++I) { OS << '\n'; - PrintFilename(OS, File, OutputFormat); + PrintFilename(OS, *I, OutputFormat); OS << ":\n"; } } diff --git a/test/Preprocessor/dependencies-and-pp.c b/test/Preprocessor/dependencies-and-pp.c index fb49638040..8bf32dc0fd 100644 --- a/test/Preprocessor/dependencies-and-pp.c +++ b/test/Preprocessor/dependencies-and-pp.c @@ -32,5 +32,12 @@ // RUN: FileCheck -check-prefix=TEST5 %s < %t.d // TEST5: foo $$(bar) b az qu\ ux \ space: +// Test self dependency, PR31644 + +// RUN: %clang -E -MD -MP -MF %t.d %s +// RUN: FileCheck -check-prefix=TEST6 %s < %t.d +// TEST6: dependencies-and-pp.c +// TEST6-NOT: dependencies-and-pp.c: + // TODO: Test default target without quoting // TODO: Test default target with quoting |