Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / preferred_name / TestPreferredName.py
blobf96bedf034ffa5bfde55d587bef9637b935516ad
1 """
2 Test formatting of types annotated with
3 [[clang::preferred_name]] attributes.
4 """
6 import lldb
7 import lldbsuite.test.lldbutil as lldbutil
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test.decorators import *
12 class TestPreferredName(TestBase):
13 @skipIf(compiler="clang", compiler_version=["<", "16.0"])
14 def test_frame_var(self):
15 self.build()
16 lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.cpp"))
18 self.expect("frame variable barInt", substrs=["BarInt"])
19 self.expect("frame variable barDouble", substrs=["BarDouble"])
20 self.expect("frame variable barShort", substrs=["Bar<short>"])
21 self.expect("frame variable barChar", substrs=["Bar<char>"])
23 self.expect("frame variable varInt", substrs=["BarInt"])
24 self.expect("frame variable varDouble", substrs=["BarDouble"])
25 self.expect("frame variable varShort", substrs=["Bar<short>"])
26 self.expect("frame variable varChar", substrs=["Bar<char>"])
27 self.expect("frame variable varFooInt", substrs=["Foo<BarInt>"])
29 @skipIf(compiler="clang", compiler_version=["<", "16.0"])
30 def test_expr(self):
31 self.build()
32 lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.cpp"))
34 self.expect_expr("barInt", result_type="BarInt")
35 self.expect_expr("barDouble", result_type="BarDouble")
36 self.expect_expr("barShort", result_type="Bar<short>")
37 self.expect_expr("barChar", result_type="Bar<char>")
39 self.expect_expr("varInt", result_type="BarInt")
40 self.expect_expr("varDouble", result_type="BarDouble")
41 self.expect_expr("varShort", result_type="Bar<short>")
42 self.expect_expr("varChar", result_type="Bar<char>")
43 self.expect_expr("varFooInt", result_type="Foo<BarInt>")