1# coding=utf8 2""" 3Test that C++ supports char8_t correctly. 4""" 5 6 7import lldb 8from lldbsuite.test.decorators import * 9from lldbsuite.test.lldbtest import * 10import lldbsuite.test.lldbutil as lldbutil 11 12 13class CxxChar8_tTestCase(TestBase): 14 15 mydir = TestBase.compute_mydir(__file__) 16 17 @skipIf(compiler="clang", compiler_version=['<', '7.0']) 18 def test(self): 19 """Test that C++ supports char8_t correctly.""" 20 self.build() 21 lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp")) 22 23 self.expect_expr("a", result_type="char8_t", result_summary="0x61 u8'a'") 24 self.expect_expr("ab", result_type="const char8_t *", result_summary='u8"你好"') 25 self.expect_expr("abc", result_type="char8_t[9]", result_summary='u8"你好"') 26