summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer/unicode.c
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-01-30 01:52:57 +0000
committerJordan Rose <jordan_rose@apple.com>2013-01-30 01:52:57 +0000
commit17441589c324f88c95e98c7e5d8d5e55cdd7c949 (patch)
treeab02a8bb2bf16030d81bed1f8e093fc974d19293 /clang/test/Lexer/unicode.c
parent1105821f55d85c49040934eb842b25e124b01766 (diff)
downloadbcm5719-llvm-17441589c324f88c95e98c7e5d8d5e55cdd7c949.tar.gz
bcm5719-llvm-17441589c324f88c95e98c7e5d8d5e55cdd7c949.zip
Don't warn about Unicode characters in -E mode.
People use the C preprocessor for things other than C files. Some of them have Unicode characters. We shouldn't warn about Unicode characters appearing outside of identifiers in this case. There's not currently a way for the preprocessor to tell if it's in -E mode, so I added a new flag, derived from the PreprocessorOutputOptions. This is only used by the Unicode warnings for now, but could conceivably be used by other warnings or even behavioral differences later. <rdar://problem/13107323> llvm-svn: 173881
Diffstat (limited to 'clang/test/Lexer/unicode.c')
-rw-r--r--clang/test/Lexer/unicode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Lexer/unicode.c b/clang/test/Lexer/unicode.c
index 1d7b53e2c5e..26e77f61fdd 100644
--- a/clang/test/Lexer/unicode.c
+++ b/clang/test/Lexer/unicode.c
@@ -1,6 +1,15 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -E -DPP_ONLY=1 %s -o %t
+// RUN: FileCheck --strict-whitespace --input-file=%t %s
// This file contains Unicode characters; please do not "fix" them!
extern int x; // expected-warning {{treating Unicode character as whitespace}}
extern int x; // expected-warning {{treating Unicode character as whitespace}}
+
+// CHECK: extern int {{x}}
+// CHECK: extern int {{x}}
+
+#if PP_ONLY
+CHECK: The preprocessor should not complain about Unicode characters like ©.
+#endif
OpenPOWER on IntegriCloud