3 Test that the expression parser returns proper Unicode strings.
6 from __future__ import print_function
12 from lldbsuite.test.decorators import *
13 from lldbsuite.test.lldbtest import *
14 from lldbsuite.test import lldbutil
16 # this test case fails because of rdar://12991846
17 # the expression parser does not deal correctly with Unicode expressions
20 #(const wchar_t [6]) $0 = {
30 class UnicodeLiteralsTestCase(TestBase):
32 mydir = TestBase.compute_mydir(__file__)
36 bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
38 """Test that the expression parser returns proper Unicode strings."""
40 self.rdar12991846(expr=1)
44 bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
46 """Test that the expression parser returns proper Unicode strings."""
48 self.rdar12991846(expr=2)
52 bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
54 """Test that the expression parser returns proper Unicode strings."""
56 self.rdar12991846(expr=3)
59 # Call super's setUp().
61 # Find the line number to break for main.cpp.
62 self.source = 'main.cpp'
63 self.line = line_number(
64 self.source, '// Set break point at this line.')
66 def rdar12991846(self, expr=None):
67 """Test that the expression parser returns proper Unicode strings."""
68 if self.getArchitecture() in ['i386']:
70 "Skipping because this test is known to crash on i386")
72 exe = os.path.join(os.getcwd(), "a.out")
74 # Create a target by the debugger.
75 target = self.dbg.CreateTarget(exe)
76 self.assertTrue(target, VALID_TARGET)
78 # Break on the struct declration statement in main.cpp.
79 lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line)
81 # Now launch the process, and do not stop at entry point.
82 process = target.LaunchSimple(
83 None, None, self.get_process_working_directory())
86 self.fail("SBTarget.Launch() failed")
89 self.expect('expression L"hello"', substrs=['hello'])
92 self.expect('expression u"hello"', substrs=['hello'])
95 self.expect('expression U"hello"', substrs=['hello'])