diff options
author | Nico Weber <nicolasweber@gmx.de> | 2010-10-06 04:57:26 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2010-10-06 04:57:26 +0000 |
commit | 9762e0a2348bce3e7e90ddf6e32309d119f48066 (patch) | |
tree | 060fa72899d1481f380e0bcb8ca18584eac764d0 /clang/test/CodeGen/string-literal.c | |
parent | 28f034c21af118004b3f615a2d0244072bda01c4 (diff) | |
download | bcm5719-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.c')
-rw-r--r-- | clang/test/CodeGen/string-literal.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/CodeGen/string-literal.c b/clang/test/CodeGen/string-literal.c index 22a81e71855..457ff6ca7ae 100644 --- a/clang/test/CodeGen/string-literal.c +++ b/clang/test/CodeGen/string-literal.c @@ -1,7 +1,16 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - +// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s int main() { + // CHECK: internal constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1 char a[10] = "abc"; + // 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 [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00" void *foo = L"AB"; + + // CHECK: private constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00" + void *bar = L"\u1234\U0010F00B"; } |