Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / char8_t / TestCxxChar8_t.py
blob4eb5351eefc82de822485b692590d1cacdc2c616
1 # coding=utf8
2 """
3 Test that C++ supports char8_t correctly.
4 """
7 import lldb
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."""
18 self.build()
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."""
34 self.build()
35 lldbutil.run_to_source_breakpoint(
36 self, "// break here", lldb.SBFileSpec("main.cpp")
39 # As well as with it
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"你好"')