summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer/case-insensitive-include-ms.c
diff options
context:
space:
mode:
authorTaewook Oh <twoh@fb.com>2016-06-13 20:40:21 +0000
committerTaewook Oh <twoh@fb.com>2016-06-13 20:40:21 +0000
commitf42103ce8b38a1a534ae08a5f44ec28a8df034fe (patch)
treeb3648d39a13b48498873a65e81ab754b3b81d90c /clang/test/Lexer/case-insensitive-include-ms.c
parent92375f55ed9341cd6ecf8f34f6c1975a1b892a72 (diff)
downloadbcm5719-llvm-f42103ce8b38a1a534ae08a5f44ec28a8df034fe.tar.gz
bcm5719-llvm-f42103ce8b38a1a534ae08a5f44ec28a8df034fe.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 of r272562 after addressing clang-x86-win2008-selfhost failure. llvm-svn: 272584
Diffstat (limited to 'clang/test/Lexer/case-insensitive-include-ms.c')
-rw-r--r--clang/test/Lexer/case-insensitive-include-ms.c18
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. :-(
OpenPOWER on IntegriCloud