From 99e2fa87f8c0bc46d1f739d2d378bc3ea6007c60 Mon Sep 17 00:00:00 2001 From: Seth Cantrell Date: Wed, 18 Apr 2012 02:44:46 +0000 Subject: 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 while bytes that do not represent valid characters are shown as . 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: 154980 --- clang/test/Misc/wrong-encoding.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 clang/test/Misc/wrong-encoding.c (limited to 'clang/test/Misc/wrong-encoding.c') 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: {{^ ""; // }} +// CHECK: {{^ \^}} + + /* þ« */ const char *d = "¥"; + +// CHECK: {{^ /\* \*/ const char \*d = "";}} +// CHECK: {{^ \^}} + +// CHECK: {{^ ""; // }} +// CHECK: {{^ \^~~~~~~~~~}} +} -- cgit v1.2.3