diff options
author | Seth Cantrell <seth.cantrell@gmail.com> | 2012-04-17 20:06:03 +0000 |
---|---|---|
committer | Seth Cantrell <seth.cantrell@gmail.com> | 2012-04-17 20:06:03 +0000 |
commit | fae205811e875f28d105e125b3af77f3f1011d56 (patch) | |
tree | df17038270cf76bfa002edc8533f6d9a0b8138b7 /clang/test/Misc/wrong-encoding.c | |
parent | 75dbcb8bdd0c90a1121b232aa253bc8ebbbf4304 (diff) | |
download | bcm5719-llvm-fae205811e875f28d105e125b3af77f3f1011d56.tar.gz bcm5719-llvm-fae205811e875f28d105e125b3af77f3f1011d56.zip |
Nicer display of unprintable source, and fix caret display for non-ascii text
Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.
Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.
llvm-svn: 154946
Diffstat (limited to 'clang/test/Misc/wrong-encoding.c')
-rw-r--r-- | clang/test/Misc/wrong-encoding.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Misc/wrong-encoding.c b/clang/test/Misc/wrong-encoding.c new file mode 100644 index 00000000000..bd1cf3dc02a --- /dev/null +++ b/clang/test/Misc/wrong-encoding.c @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s + +void foo() { + + "§Ã"; // ø +// CHECK: {{^ "<A7><C3>"; // <F8>}} +// CHECK: {{^ \^}} + + /* þ« */ const char *d = "¥"; + +// CHECK: {{^ /\* <FE><AB> \*/ const char \*d = "<A5>";}} +// CHECK: {{^ \^}} + +// CHECK: {{^ "<A7><C3>"; // <F8>}} +// CHECK: {{^ \^~~~~~~~~~}} +} |