summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-08-26 23:19:21 +0000
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-08-26 23:19:21 +0000
commit2abca4f06cfeb8d1a93ff5a19b90a116f7a8b62c (patch)
tree42263dc0695be010715e35c790f65fde9b2fe84c /clang/test/Lexer
parentb26bc34e3a77cab8b2773c69f27198f77f993090 (diff)
downloadbcm5719-llvm-2abca4f06cfeb8d1a93ff5a19b90a116f7a8b62c.tar.gz
bcm5719-llvm-2abca4f06cfeb8d1a93ff5a19b90a116f7a8b62c.zip
[clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings
Previously, an #error directive with quoted, multi-line content, along with CR+LF line endings wasn't handled correctly. Differential Revision: https://reviews.llvm.org/D66556 llvm-svn: 369986
Diffstat (limited to 'clang/test/Lexer')
-rw-r--r--clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c b/clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c
new file mode 100644
index 00000000000..91005e566f1
--- /dev/null
+++ b/clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c
@@ -0,0 +1,16 @@
+// Test CF+LF are properly handled along with quoted, multi-line #error
+// RUN: cat %s | unix2dos | %clang_cc1 -DOTHER -print-dependency-directives-minimized-source 2>&1 | FileCheck %s
+
+#ifndef TEST
+#error "message \
+ more message \
+ even more"
+#endif
+
+#ifdef OTHER
+#include <string>
+#endif
+
+// CHECK: #ifdef OTHER
+// CHECK-NEXT: #include <string>
+// CHECK-NEXT: #endif
OpenPOWER on IntegriCloud