3 Test that C++ supports char8_t correctly.
8 from lldbsuite
.test
.decorators
import *
9 from lldbsuite
.test
.lldbtest
import *
10 import lldbsuite
.test
.lldbutil
as lldbutil
13 class CxxChar8_tTestCase(TestBase
):
14 @skipIfDarwin # Chained Fixups
15 @skipIf(compiler
="clang", compiler_version
=["<", "7.0"])
16 def test_without_process(self
):
17 """Test that C++ supports char8_t without a running process."""
19 lldbutil
.run_to_breakpoint_make_target(self
)
21 self
.expect("target variable a", substrs
=["char8_t", "0x61 u8'a'"])
22 self
.expect("target variable ab", substrs
=["const char8_t *", 'u8"你好"'])
23 self
.expect("target variable abc", substrs
=["char8_t[9]", 'u8"你好"'])
25 self
.expect_expr("a", result_type
="char8_t", result_summary
="0x61 u8'a'")
26 self
.expect_expr("ab", result_type
="const char8_t *", result_summary
='u8"你好"')
28 # FIXME: This should work too.
29 self
.expect("expr abc", substrs
=['u8"你好"'], matching
=False)
31 @skipIf(compiler
="clang", compiler_version
=["<", "7.0"])
32 def test_with_process(self
):
33 """Test that C++ supports char8_t with a running process."""
35 lldbutil
.run_to_source_breakpoint(
36 self
, "// break here", lldb
.SBFileSpec("main.cpp")
40 self
.expect_expr("a", result_type
="char8_t", result_summary
="0x61 u8'a'")
41 self
.expect_expr("ab", result_type
="const char8_t *", result_summary
='u8"你好"')
42 self
.expect_expr("abc", result_type
="char8_t[9]", result_summary
='u8"你好"')