summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Lexer/string-literal-errors.cpp25
-rw-r--r--clang/test/Misc/wrong-encoding.c4
2 files changed, 27 insertions, 2 deletions
diff --git a/clang/test/Lexer/string-literal-errors.cpp b/clang/test/Lexer/string-literal-errors.cpp
new file mode 100644
index 00000000000..be574c2a557
--- /dev/null
+++ b/clang/test/Lexer/string-literal-errors.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+
+void foo() {
+ (void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U"
+ // CHECK: {{^ \(void\)"\\q \\u123z \\x \\U \\U123 \\U12345 \\u123 \\xyzzy \\777 \\U"$}}
+ //
+ // (void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U"
+ // CHECK: {{^ \^~$}}
+ // CHECK: {{^ \^~~~~$}}
+ // CHECK: {{^ \^~$}}
+ // CHECK: {{^ \^~$}}
+ // CHECK: {{^ \^~~~~$}}
+ // CHECK: {{^ \^~~~~~~$}}
+ // CHECK: {{^ \^~~~~$}}
+ // CHECK: {{^ \^~$}}
+ // CHECK: {{^ \^~~~$}}
+ // CHECK: {{^ \^~$}}
+
+ "123 \x \z";
+ // CHECK: {{^ "123 \\x \\z";$}}
+ //
+ // "123 \x \z";
+ // CHECK: {{^ \^~$}}
+ // CHECK: {{^ \^~$}}
+}
diff --git a/clang/test/Misc/wrong-encoding.c b/clang/test/Misc/wrong-encoding.c
index bd1cf3dc02a..476c783c24e 100644
--- a/clang/test/Misc/wrong-encoding.c
+++ b/clang/test/Misc/wrong-encoding.c
@@ -4,12 +4,12 @@ void foo() {
"§Ã"; // ø
// CHECK: {{^ "<A7><C3>"; // <F8>}}
-// CHECK: {{^ \^}}
+// CHECK: {{^ \^~~~}}
/* þ« */ const char *d = "¥";
// CHECK: {{^ /\* <FE><AB> \*/ const char \*d = "<A5>";}}
-// CHECK: {{^ \^}}
+// CHECK: {{^ \^~~~}}
// CHECK: {{^ "<A7><C3>"; // <F8>}}
// CHECK: {{^ \^~~~~~~~~~}}
OpenPOWER on IntegriCloud