blob: a7f37e868b4dd3d0c59199f12c87808c2fded82f [file] [log] [blame]
Thiébaud Weksteene40e7362020-10-28 15:03:00 +01001import 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
Chris Wailesbcf972c2021-10-21 11:03:28 -070023 @skipIf(oslist=["linux"], archs=["arm"], bugnumber="llvm.org/pr23069")
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010024 @expectedFailureAll(
25 archs=[
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010026 "aarch64",
27 "powerpc64le",
28 "s390x"],
29 bugnumber="llvm.org/pr23069")
30 def test_signed_char(self):
31 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
32
33 @expectedFailureAll(
34 archs=[
35 "i[3-6]86",
36 "x86_64",
37 "arm64",
38 'arm64e',
39 'armv7',
40 'armv7k',
41 'arm64_32'],
42 bugnumber="llvm.org/pr23069, <rdar://problem/28721938>")
43 @expectedFailureAll(triple='mips*', bugnumber="llvm.org/pr23069")
44 def test_unsigned_char(self):
45 self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})