aboutsummaryrefslogtreecommitdiff
path: root/test/Misc/wrong-encoding.c
diff options
context:
space:
mode:
authorSeth Cantrell <seth.cantrell@gmail.com>2012-10-28 18:24:46 +0000
committerSeth Cantrell <seth.cantrell@gmail.com>2012-10-28 18:24:46 +0000
commit5bffbe5c1033967fe49c7a638fdcea99d30d573a (patch)
treeb0668bd4f41d01201f289d6aafb68f30a46b1d13 /test/Misc/wrong-encoding.c
parentc36e3596be351a557cc81c8db3ea75fa4bd54c7a (diff)
improve highlighting of invalid string encodings
limit highlight to exactly the bad encoding, and highlight every bad encoding in a string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Misc/wrong-encoding.c')
-rw-r--r--test/Misc/wrong-encoding.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/test/Misc/wrong-encoding.c b/test/Misc/wrong-encoding.c
index 476c783c24..db37af9d2b 100644
--- a/test/Misc/wrong-encoding.c
+++ b/test/Misc/wrong-encoding.c
@@ -1,16 +1,33 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value %s 2>&1 | FileCheck -strict-whitespace %s
void foo() {
"§Ã"; // ø
// CHECK: {{^ "<A7><C3>"; // <F8>}}
-// CHECK: {{^ \^~~~}}
+// CHECK: {{^ \^~~~~~~}}
/* þ« */ const char *d = "¥";
// CHECK: {{^ /\* <FE><AB> \*/ const char \*d = "<A5>";}}
// CHECK: {{^ \^~~~}}
-// CHECK: {{^ "<A7><C3>"; // <F8>}}
-// CHECK: {{^ \^~~~~~~~~~}}
+ "xxé¿¿¿d";
+// CHECK: {{^ "xx<U\+9FFF><BF>d";}}
+// CHECK: {{^ \^~~~}}
+
+ "xxé¿bcd";
+// CHECK: {{^ "xx<E9><BF>bcd";}}
+// CHECK: {{^ \^~~~~~~~}}
+
+ "xxéabcd";
+// CHECK: {{^ "xx<E9>abcd";}}
+// CHECK: {{^ \^~~~}}
+
+ "xxé¿é¿d";
+// CHECK: {{^ "xx<E9><BF><E9><BF>d";}}
+// CHECK: {{^ \^~~~~~~~~~~~~~~}}
+
+ "xxé¿xxxxxxxxxxxxxxxxxxxxxé¿xx";
+// CHECK: {{^ "xx<E9><BF>xxxxxxxxxxxxxxxxxxxxx<E9><BF>xx";}}
+// CHECK: {{^ \^~~~~~~~ ~~~~~~~~}}
}