diff options
| author | Taewook Oh <twoh@fb.com> | 2016-06-13 17:03:18 +0000 |
|---|---|---|
| committer | Taewook Oh <twoh@fb.com> | 2016-06-13 17:03:18 +0000 |
| commit | e8533670bf22cda6339664618b2b0bfd76f83661 (patch) | |
| tree | 268b16d618cd14c2c87f34ad0bab4b9ab4f063ac /clang/test/Lexer/case-insensitive-include-ms.c | |
| parent | 34c72c4773989d65460542f6425fda8b5d509586 (diff) | |
| download | bcm5719-llvm-e8533670bf22cda6339664618b2b0bfd76f83661.tar.gz bcm5719-llvm-e8533670bf22cda6339664618b2b0bfd76f83661.zip | |
Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths.
Differential Revision: http://reviews.llvm.org/D19843
Corresponding LLVM change: http://reviews.llvm.org/D19842
Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures.
Patch by Eric Niebler
llvm-svn: 272562
Diffstat (limited to 'clang/test/Lexer/case-insensitive-include-ms.c')
| -rw-r--r-- | clang/test/Lexer/case-insensitive-include-ms.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Lexer/case-insensitive-include-ms.c b/clang/test/Lexer/case-insensitive-include-ms.c new file mode 100644 index 00000000000..86bd8bba68e --- /dev/null +++ b/clang/test/Lexer/case-insensitive-include-ms.c @@ -0,0 +1,18 @@ +// REQUIRES: case-insensitive-filesystem + +// RUN: mkdir -p %T/apath +// RUN: cp %S/Inputs/case-insensitive-include.h %T +// RUN: cd %T +// RUN: %clang_cc1 -fsyntax-only -fms-compatibility %s -include %s -I %T -verify +// RUN: %clang_cc1 -fsyntax-only -fms-compatibility -fdiagnostics-parseable-fixits %s -include %s -I %T 2>&1 | FileCheck %s + +#include "..\Output\.\case-insensitive-include.h" +#include "..\Output\.\Case-Insensitive-Include.h" // expected-warning {{non-portable path}} +// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:50}:"\"..\\Output\\.\\case-insensitive-include.h\"" +#include "..\output\.\case-insensitive-include.h" // expected-warning {{non-portable path}} +// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:50}:"\"..\\Output\\.\\case-insensitive-include.h\"" + +#include "apath\..\.\case-insensitive-include.h" +#include "apath\..\.\Case-Insensitive-Include.h" // expected-warning {{non-portable path}} +// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:49}:"\"apath\\..\\.\\case-insensitive-include.h\"" +#include "APath\..\.\case-insensitive-include.h" // For the sake of efficiency, this case is not diagnosed. :-( |

