summaryrefslogtreecommitdiff
path: root/test/Lexer
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-08-27 00:13:52 +0000
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-08-27 00:13:52 +0000
commitcc90d37097d7e62dd9ee126b259acd43976a2b5a (patch)
tree7398beb0bad290dfad1c56aa0541c056f981465d /test/Lexer
parent7d7c9e971144670b8a974def446d80e206839d11 (diff)
downloadclang-cc90d37097d7e62dd9ee126b259acd43976a2b5a.tar.gz
[clang-scan-deps] Skip UTF-8 BOM in source minimizer
Differential Revision: https://reviews.llvm.org/D66511 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r--test/Lexer/minimize_source_to_dependency_directives_utf8bom.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c b/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c
new file mode 100644
index 0000000000..305442fbd2
--- /dev/null
+++ b/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c
@@ -0,0 +1,10 @@
+// Test UTF8 BOM at start of file
+// RUN: printf '\xef\xbb\xbf' > %t.c
+// RUN: echo '#ifdef TEST\n' >> %t.c
+// RUN: echo '#include <string>' >> %t.c
+// RUN: echo '#endif' >> %t.c
+// RUN: %clang_cc1 -DTEST -print-dependency-directives-minimized-source %t.c 2>&1 | FileCheck %s
+
+// CHECK: #ifdef TEST
+// CHECK-NEXT: #include <string>
+// CHECK-NEXT: #endif