1import lldb
2from lldbsuite.test.decorators import *
3from lldbsuite.test.lldbtest import *
4from lldbsuite.test import lldbutil
5
6class ExprCharTestCase(TestBase):
7
8    mydir = TestBase.compute_mydir(__file__)
9
10    def do_test(self, dictionary=None):
11        """These basic expression commands should work as expected."""
12        self.build(dictionary=dictionary)
13
14        lldbutil.run_to_source_breakpoint(self, '// Break here', lldb.SBFileSpec("main.cpp"))
15
16        self.expect_expr("foo(c)", result_value="1")
17        self.expect_expr("foo(sc)", result_value="2")
18        self.expect_expr("foo(uc)", result_value="3")
19
20    def test_default_char(self):
21        self.do_test()
22
23    @skipIf(oslist=["linux"], archs=["aarch64", "arm"], bugnumber="llvm.org/pr23069")
24    @expectedFailureAll(
25        archs=[
26            "powerpc64le",
27            "s390x"],
28        bugnumber="llvm.org/pr23069")
29    def test_signed_char(self):
30        self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
31
32    @expectedFailureAll(
33        archs=[
34            "i[3-6]86",
35            "x86_64",
36            "arm64",
37            'arm64e',
38            'armv7',
39            'armv7k',
40            'arm64_32'],
41        bugnumber="llvm.org/pr23069, <rdar://problem/28721938>")
42    @expectedFailureAll(triple='mips*', bugnumber="llvm.org/pr23069")
43    def test_unsigned_char(self):
44        self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})
45