Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / unicode-literals / TestUnicodeLiterals.py
blob50f337c81d9f12dc8b00f8eb7e6ddcfa33b14872
1 # coding=utf8
2 """
3 Test that the expression parser returns proper Unicode strings.
4 """
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
12 # this test case fails because of rdar://12991846
13 # the expression parser does not deal correctly with Unicode expressions
14 # e.g.
15 # (lldb) expr L"Hello"
16 # (const wchar_t [6]) $0 = {
17 # [0] = \0\0\0\0
18 # [1] = \0\0\0\0
19 # [2] = \0\0\0\0
20 # [3] = \0\0\0\0
21 # [4] = H\0\0\0
22 # [5] = e\0\0\0
23 # }
26 class UnicodeLiteralsTestCase(TestBase):
27 def test_expr1(self):
28 """Test that the expression parser returns proper Unicode strings."""
29 self.rdar12991846(expr=1)
31 def test_expr2(self):
32 """Test that the expression parser returns proper Unicode strings."""
33 self.rdar12991846(expr=2)
35 def test_expr3(self):
36 """Test that the expression parser returns proper Unicode strings."""
37 self.rdar12991846(expr=3)
39 def rdar12991846(self, expr=None):
40 """Test that the expression parser returns proper Unicode strings."""
41 if self.getArchitecture() in ["i386"]:
42 self.skipTest("Skipping because this test is known to crash on i386")
44 self.build()
45 lldbutil.run_to_source_breakpoint(
46 self, "// Set break point at this line", lldb.SBFileSpec("main.cpp")
49 if expr == 1:
50 self.expect('expression L"hello"', substrs=["hello"])
52 if expr == 2:
53 self.expect('expression u"hello"', substrs=["hello"])
55 if expr == 3:
56 self.expect('expression U"hello"', substrs=["hello"])