diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-11-01 02:23:42 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-11-01 02:23:42 +0000 |
commit | 64f45a24b19eb89ff88f7c3ff0df9be8e861ac97 (patch) | |
tree | de9dd9c4244910961e8d67b69a0a83be4306154f /test | |
parent | f74a4587629615ffd13bd0724868f86ba8c8f27b (diff) | |
download | clang-64f45a24b19eb89ff88f7c3ff0df9be8e861ac97.tar.gz |
Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
treating wide strings as a series of bytes.
Patch by Seth Cantrell.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/global-init.c | 2 | ||||
-rw-r--r-- | test/CodeGen/pascal-wchar-string.c | 4 | ||||
-rw-r--r-- | test/CodeGen/string-literal-short-wstring.c | 4 | ||||
-rw-r--r-- | test/CodeGen/string-literal.c | 30 | ||||
-rw-r--r-- | test/CodeGen/wchar-const.c | 4 | ||||
-rw-r--r-- | test/CodeGenCXX/uncode-string.cpp | 2 |
6 files changed, 23 insertions, 23 deletions
diff --git a/test/CodeGen/global-init.c b/test/CodeGen/global-init.c index 074c2a065a..dab5a07d61 100644 --- a/test/CodeGen/global-init.c +++ b/test/CodeGen/global-init.c @@ -32,7 +32,7 @@ struct ManyFields FewInits = {1, 2}; // PR6766 -// CHECK: @l = global { [24 x i8], i32 } { [24 x i8] c"f\00\00\00o\00\00\00o\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 1 } +// CHECK: @l = global %struct.K { [6 x i32] [i32 102, i32 111, i32 111, i32 0, i32 0, i32 0], i32 1 } typedef __WCHAR_TYPE__ wchar_t; struct K { wchar_t L[6]; diff --git a/test/CodeGen/pascal-wchar-string.c b/test/CodeGen/pascal-wchar-string.c index a6b619643e..626fc99f15 100644 --- a/test/CodeGen/pascal-wchar-string.c +++ b/test/CodeGen/pascal-wchar-string.c @@ -29,8 +29,8 @@ int main(int argc, char* argv[]) return 0; } -// CHECK: c"\03\00b\00a\00r\00\00\00" -// CHECK: c"\04\00g\00o\00r\00f\00\00\00" +// CHECK: [i16 3, i16 98, i16 97, i16 114, i16 0] +// CHECK: [i16 4, i16 103, i16 111, i16 114, i16 102, i16 0] // PR8856 - -fshort-wchar makes wchar_t be unsigned. diff --git a/test/CodeGen/string-literal-short-wstring.c b/test/CodeGen/string-literal-short-wstring.c index 770c3d4268..309ffd33b2 100644 --- a/test/CodeGen/string-literal-short-wstring.c +++ b/test/CodeGen/string-literal-short-wstring.c @@ -6,11 +6,11 @@ int main() { // CHECK: private unnamed_addr 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 unnamed_addr constant [6 x i8] c"A\00B\00\00\00" + // CHECK: private unnamed_addr constant [3 x i16] [i16 65, i16 66, i16 0] const wchar_t *foo = L"AB"; // This should convert to utf16. - // CHECK: private unnamed_addr constant [10 x i8] c" \11 \02\C8\DB0\DC\00\00" + // CHECK: private unnamed_addr constant [5 x i16] [i16 4384, i16 544, i16 -9272, i16 -9168, i16 0] const wchar_t *bar = L"\u1120\u0220\U00102030"; diff --git a/test/CodeGen/string-literal.c b/test/CodeGen/string-literal.c index fa8f28a766..12d431a454 100644 --- a/test/CodeGen/string-literal.c +++ b/test/CodeGen/string-literal.c @@ -14,37 +14,37 @@ int main() { // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1 char b[10] = "\u1120\u0220\U00102030"; - // CHECK-C: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 4 - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 4 + // CHECK-C: private unnamed_addr constant [3 x i32] [i32 65, i32 66, i32 0], align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 65, i32 66, i32 0], align 4 const wchar_t *foo = L"AB"; - // CHECK-C: private unnamed_addr constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00", align 4 - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00", align 4 + // CHECK-C: private unnamed_addr constant [3 x i32] [i32 4660, i32 1110027, i32 0], align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 4660, i32 1110027, i32 0], align 4 const wchar_t *bar = L"\u1234\U0010F00B"; - // CHECK-C: private unnamed_addr constant [12 x i8] c"4\12\00\00\0C\F0\10\00\00\00\00\00", align 4 - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"4\12\00\00\0C\F0\10\00\00\00\00\00", align 4 + // CHECK-C: private unnamed_addr constant [3 x i32] [i32 4660, i32 1110028, i32 0], align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 4660, i32 1110028, i32 0], align 4 const wchar_t *baz = L"\u1234" "\U0010F00C"; #if __cplusplus >= 201103L - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"C\00\00\00D\00\00\00\00\00\00\00", align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 67, i32 68, i32 0], align 4 const char32_t *c = U"CD"; - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"5\12\00\00\0C\F0\10\00\00\00\00\00", align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 4661, i32 1110028, i32 0], align 4 const char32_t *d = U"\u1235\U0010F00C"; - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"5\12\00\00\0B\F0\10\00\00\00\00\00", align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 4661, i32 1110027, i32 0], align 4 const char32_t *o = "\u1235" U"\U0010F00B"; - // CHECK-CPP0X: private unnamed_addr constant [6 x i8] c"E\00F\00\00\00", align 2 + // CHECK-CPP0X: private unnamed_addr constant [3 x i16] [i16 69, i16 70, i16 0], align 2 const char16_t *e = u"EF"; // This should convert to utf16. - // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c" \11 \02\C8\DB0\DC\00\00", align 2 + // CHECK-CPP0X: private unnamed_addr constant [5 x i16] [i16 4384, i16 544, i16 -9272, i16 -9168, i16 0], align 2 const char16_t *f = u"\u1120\u0220\U00102030"; // This should convert to utf16. - // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c" \11 \03\C8\DB0\DC\00\00", align 2 + // CHECK-CPP0X: private unnamed_addr constant [5 x i16] [i16 4384, i16 800, i16 -9272, i16 -9168, i16 0], align 2 const char16_t *p = u"\u1120\u0320" "\U00102030"; // CHECK-CPP0X: private unnamed_addr constant [4 x i8] c"def\00", align 1 @@ -56,13 +56,13 @@ int main() { // CHECK-CPP0X: private unnamed_addr constant [4 x i8] c"jkl\00", align 1 const char *i = u8R"bar(jkl)bar"; - // CHECK-CPP0X: private unnamed_addr constant [6 x i8] c"G\00H\00\00\00", align 2 + // CHECK-CPP0X: private unnamed_addr constant [3 x i16] [i16 71, i16 72, i16 0], align 2 const char16_t *j = uR"foo(GH)foo"; - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"I\00\00\00J\00\00\00\00\00\00\00", align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 73, i32 74, i32 0], align 4 const char32_t *k = UR"bar(IJ)bar"; - // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"K\00\00\00L\00\00\00\00\00\00\00", align 4 + // CHECK-CPP0X: private unnamed_addr constant [3 x i32] [i32 75, i32 76, i32 0], align 4 const wchar_t *l = LR"bar(KL)bar"; // CHECK-CPP0X: private unnamed_addr constant [9 x i8] c"abc\5Cndef\00", align 1 diff --git a/test/CodeGen/wchar-const.c b/test/CodeGen/wchar-const.c index b672b15360..a9e7e523f9 100644 --- a/test/CodeGen/wchar-const.c +++ b/test/CodeGen/wchar-const.c @@ -14,8 +14,8 @@ typedef __WCHAR_TYPE__ wchar_t; #endif -// CHECK-DAR: private unnamed_addr constant [72 x i8] c" -// CHECK-WIN: private unnamed_addr constant [36 x i8] c" +// CHECK-DAR: private unnamed_addr constant [18 x i32] [i32 84, +// CHECK-WIN: private unnamed_addr constant [18 x i16] [i16 84, extern void foo(const wchar_t* p); int main (int argc, const char * argv[]) { diff --git a/test/CodeGenCXX/uncode-string.cpp b/test/CodeGenCXX/uncode-string.cpp index e543149747..1d839992f9 100644 --- a/test/CodeGenCXX/uncode-string.cpp +++ b/test/CodeGenCXX/uncode-string.cpp @@ -3,4 +3,4 @@ wchar_t s[] = L"\u2722"; -// CHECK: @s = global [8 x i8] c"\22'\00\00\00\00\00\00" +// CHECK: @s = global [2 x i32] [i32 10018, i32 0], align 4 |