brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 08f09b3 Raw
41 lines · python
1# coding=utf82"""3Test that C++ supports char8_t correctly.4"""5 6 7import lldb8from lldbsuite.test.decorators import *9from lldbsuite.test.lldbtest import *10import lldbsuite.test.lldbutil as lldbutil11 12 13class CxxChar8_tTestCase(TestBase):14    @skipIfDarwin  # Chained Fixups15    @skipIf(compiler="clang", compiler_version=["<", "7.0"])16    def test_without_process(self):17        """Test that C++ supports char8_t without a running process."""18        self.build()19        lldbutil.run_to_breakpoint_make_target(self)20 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"你好"'])24 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"你好"')27        self.expect_expr("abc", result_type="char8_t[9]", result_summary='u8"你好"')28 29    @skipIf(compiler="clang", compiler_version=["<", "7.0"])30    def test_with_process(self):31        """Test that C++ supports char8_t with a running process."""32        self.build()33        lldbutil.run_to_source_breakpoint(34            self, "// break here", lldb.SBFileSpec("main.cpp")35        )36 37        # As well as with it38        self.expect_expr("a", result_type="char8_t", result_summary="0x61 u8'a'")39        self.expect_expr("ab", result_type="const char8_t *", result_summary='u8"你好"')40        self.expect_expr("abc", result_type="char8_t[9]", result_summary='u8"你好"')41