diff options
| author | Paul Robinson <paul_robinson@playstation.sony.com> | 2015-05-13 21:18:15 +0000 |
|---|---|---|
| committer | Paul Robinson <paul_robinson@playstation.sony.com> | 2015-05-13 21:18:15 +0000 |
| commit | 64441def5869166d21bed7db632f8afa4e0ac7d5 (patch) | |
| tree | 1afd08654020992bd67e79791e4b4238d324f7f1 /clang/test | |
| parent | b4c61f889faee9fa94de9824f5078a45de20af89 (diff) | |
| download | bcm5719-llvm-64441def5869166d21bed7db632f8afa4e0ac7d5.tar.gz bcm5719-llvm-64441def5869166d21bed7db632f8afa4e0ac7d5.zip | |
Fix dependency file escaping.
When writing a dependency (.d) file, if space or # is immediately
preceded by one or more backslashes, escape the backslashes as well as
the space or # character. Otherwise leave backslash alone.
This straddles the fence between BSD Make (which does no escaping at
all, and does not support space or # in filespecs) and GNU Make (which
does support escaping, but will fall back to the filespec as-written
if the escaping doesn't match an existing file).
Differential Revision: http://reviews.llvm.org/D9208
llvm-svn: 237296
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Frontend/dependency-gen-escaping.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Frontend/dependency-gen-escaping.c b/clang/test/Frontend/dependency-gen-escaping.c index a6da66a169a..efa463a6eed 100644 --- a/clang/test/Frontend/dependency-gen-escaping.c +++ b/clang/test/Frontend/dependency-gen-escaping.c @@ -16,3 +16,11 @@ #include "$$.h" #include "##.h" #include "normal.h" + +// Backslash followed by # or space is handled differently than GCC does, +// because GCC doesn't emit this obscure corner case the way GNU Make wants it. +// CHECK: a\b\\\#c\\\ d.h +// These combinations are just another case for NMAKE. +// NMAKE: "a\b\#c\ d.h" + +#include "a\b\#c\ d.h" |

