From cd1eb72bab8539d16d8b5ddb7415d1292d0ce324 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Thu, 1 Dec 2016 17:46:51 +0000 Subject: Handle UTF-16 and UTF-32 constant CFStrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a longstanding issue where the expression parser does not handle wide CFStrings (e.g., @"凸凹") correctly, producing the useless error message Internal error [IRForTarget]: An Objective-C constant string's string initializer is not an array error: warning: expression result unused error: The expression could not be prepared to run in the target This is just a side effect of the fact that we don't handle wide string constants when converting these to CFStringCreateWithBytes. That function takes the string's encoding as an argument, so I made it work and added a testcase. https://reviews.llvm.org/D27291 llvm-svn: 288386 --- .../lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py | 6 ++++++ lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py create mode 100644 lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m (limited to 'lldb/packages/Python/lldbsuite/test') diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py b/lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py new file mode 100644 index 00000000000..c9986aafd7d --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py @@ -0,0 +1,6 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( + __file__, globals(), [ + decorators.skipUnlessDarwin]) diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m b/lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m new file mode 100644 index 00000000000..e55eb1ede9b --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m @@ -0,0 +1,5 @@ +#import + +int main() { + NSLog(@"凸"); //% self.expect("po @\"凹\"", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["凹"]) +} -- cgit v1.2.3