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