summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/string-literal-short-wstring.c
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2010-10-06 04:57:26 +0000
committerNico Weber <nicolasweber@gmx.de>2010-10-06 04:57:26 +0000
commit9762e0a2348bce3e7e90ddf6e32309d119f48066 (patch)
tree060fa72899d1481f380e0bcb8ca18584eac764d0 /clang/test/CodeGen/string-literal-short-wstring.c
parent28f034c21af118004b3f615a2d0244072bda01c4 (diff)
downloadbcm5719-llvm-9762e0a2348bce3e7e90ddf6e32309d119f48066.tar.gz
bcm5719-llvm-9762e0a2348bce3e7e90ddf6e32309d119f48066.zip
Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.
llvm-svn: 115743
Diffstat (limited to 'clang/test/CodeGen/string-literal-short-wstring.c')
-rw-r--r--clang/test/CodeGen/string-literal-short-wstring.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGen/string-literal-short-wstring.c b/clang/test/CodeGen/string-literal-short-wstring.c
new file mode 100644
index 00000000000..de84953dd3f
--- /dev/null
+++ b/clang/test/CodeGen/string-literal-short-wstring.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm -fshort-wchar %s -o - | FileCheck %s
+
+int main() {
+ // This should convert to utf8.
+ // CHECK: internal constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
+ char b[10] = "\u1120\u0220\U00102030";
+
+ // CHECK: private constant [6 x i8] c"A\00B\00\00\00"
+ void *foo = L"AB";
+
+ // This should convert to utf16.
+ // CHECK: private constant [10 x i8] c" \11 \02\C8\DB0\DC\00\00"
+ void *bar = L"\u1120\u0220\U00102030";
+}
OpenPOWER on IntegriCloud