]> granicus.if.org Git - clang/commitdiff
add tests for wide character encodings
authorSeth Cantrell <seth.cantrell@gmail.com>
Sat, 21 Jan 2012 00:16:11 +0000 (00:16 +0000)
committerSeth Cantrell <seth.cantrell@gmail.com>
Sat, 21 Jan 2012 00:16:11 +0000 (00:16 +0000)
and fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148603 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/char-literal.c

index 5452392ea55ba3b5c37d6952b776bf8fefdc4572..237d4b2010ee3d7778e8ec09acda46ae45ee94c4 100644 (file)
@@ -14,17 +14,17 @@ int main() {
   // CHECK-CPP0X: store i8 98
   char b = 'ab';
 
-  // Should get concatonated characters
+  // Should get concatenated characters
   // CHECK-C: store i32 24930
   // CHECK-CPP0X: store i32 24930
   int b1 = 'ab';
 
-  // Should get concatonated characters
+  // Should get concatenated characters
   // CHECK-C: store i32 808464432
   // CHECK-CPP0X: store i32 808464432
   int b2 = '0000';
 
-  // Should get truncated value (last four characters concatonated)
+  // Should get truncated value (last four characters concatenated)
   // CHECK-C: store i32 1919512167
   // CHECK-CPP0X: store i32 1919512167
   int b3 = 'somesillylongstring';
@@ -45,6 +45,20 @@ int main() {
   // CHECK-CPP0X: store i32 97
   char32_t Ua = U'a';
 
+  // CHECK-CPP0X: store i16 1047
+  char16_t ua1 = u'З';
+  // CHECK-CPP0X: store i16 12538
+  char16_t ua2 = u'ヺ';
+  // CHECK-CPP0X: store i16 -27177
+  char16_t ua3 = u'闗';
+
+  // CHECK-CPP0X: store i32 181
+  char32_t Ua1 = U'µ';
+  // CHECK-CPP0X: store i32 38359
+  char32_t Ua2 = U'闗';
+  // CHECK-CPP0X: store i32 128128
+  char32_t Ua3 = U'💀';
+
 #endif
 
   // CHECK-C: store i32 61451