|
| 1 | +import lldb |
| 2 | +import lldbsuite.test.lldbutil as lldbutil |
| 3 | +from lldbsuite.test.decorators import * |
| 4 | +from lldbsuite.test.lldbtest import * |
| 5 | + |
| 6 | + |
| 7 | +class TestTemplateAlias(TestBase): |
| 8 | + def do_test(self, extra_flags): |
| 9 | + self.build(dictionary=extra_flags) |
| 10 | + self.main_source_file = lldb.SBFileSpec("main.cpp") |
| 11 | + lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.cpp")) |
| 12 | + |
| 13 | + self.expect_expr("f1", result_type="Foo<int>") |
| 14 | + self.expect_expr("f2", result_type="Foo<double>") |
| 15 | + self.expect_expr("b1", result_type="Bar<int>") |
| 16 | + self.expect_expr("b2", result_type="Bar<double>") |
| 17 | + self.expect_expr("bf1", result_type="Bar<int>") |
| 18 | + self.expect_expr("bf2", result_type="Bar<double>") |
| 19 | + self.expect_expr("bf1", result_type="Bar<int>") |
| 20 | + self.expect_expr("bf2", result_type="Bar<double>") |
| 21 | + self.expect_expr("cbf1", result_type="Container<int>") |
| 22 | + |
| 23 | + @expectedFailureAll( |
| 24 | + bugnumber="LLDB doesn't reconstruct template alias names from template parameters" |
| 25 | + ) |
| 26 | + def test_tag_alias_simple(self): |
| 27 | + self.do_test( |
| 28 | + dict(CXXFLAGS_EXTRAS="-gdwarf-5 -gtemplate-alias -gsimple-template-names") |
| 29 | + ) |
| 30 | + |
| 31 | + def test_tag_alias_no_simple(self): |
| 32 | + self.do_test( |
| 33 | + dict( |
| 34 | + CXXFLAGS_EXTRAS="-gdwarf-5 -gtemplate-alias -gno-simple-template-names" |
| 35 | + ) |
| 36 | + ) |
| 37 | + |
| 38 | + def test_no_tag_alias_simple(self): |
| 39 | + self.do_test( |
| 40 | + dict( |
| 41 | + CXXFLAGS_EXTRAS="-gdwarf-5 -gno-template-alias -gsimple-template-names" |
| 42 | + ) |
| 43 | + ) |
| 44 | + |
| 45 | + def test_no_tag_alias_no_simple(self): |
| 46 | + self.do_test( |
| 47 | + dict( |
| 48 | + CXXFLAGS_EXTRAS="-gdwarf-5 -gno-template-alias -gno-simple-template-names" |
| 49 | + ) |
| 50 | + ) |
0 commit comments