summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-08-21 04:10:58 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-08-21 04:10:58 +0000
commit3151d7c76a641b61347b667d1e6f757b6007f548 (patch)
tree9d656bcbc02a782b81d2fe5e57119d089d7fc621 /clang/test
parentcee61339305cc00900ea7346656032447a756281 (diff)
downloadbcm5719-llvm-3151d7c76a641b61347b667d1e6f757b6007f548.tar.gz
bcm5719-llvm-3151d7c76a641b61347b667d1e6f757b6007f548.zip
Issue fixits replacing invalid character literals with the equivalent \xNN
escape code. llvm-svn: 188863
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Lexer/char-literal-encoding-fixit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Lexer/char-literal-encoding-fixit.c b/clang/test/Lexer/char-literal-encoding-fixit.c
new file mode 100644
index 00000000000..ab5d28aa53f
--- /dev/null
+++ b/clang/test/Lexer/char-literal-encoding-fixit.c
@@ -0,0 +1,11 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -fixit -x c %t
+// RUN: FileCheck -input-file=%t %t
+
+// Note that this file is not valid UTF-8.
+
+int test1 = 'ˆ';
+// CHECK: int test1 = '\x88';
+
+int test2 = 'abˆc';
+// CHECK: int test2 = 'ab\x88c';
OpenPOWER on IntegriCloud