2 from lldbsuite
.test
.decorators
import *
3 from lldbsuite
.test
.lldbtest
import *
4 from lldbsuite
.test
import lldbutil
7 class TestCase(TestBase
):
9 """Tests deferencing lvalue/rvalue references via LLDB's builtin type system."""
11 lldbutil
.run_to_source_breakpoint(
12 self
, "// break here", lldb
.SBFileSpec("main.cpp")
15 # Take an lvalue reference and call `Dereference` on the SBValue.
16 # The result should be `TTT` (and *not* for example the underlying type
18 lref_val
= self
.expect_var_path("l_ref", type="TTT &")
19 self
.assertEqual(lref_val
.Dereference().GetType().GetName(), "TTT")
21 # Same as above for rvalue references.
22 rref_val
= self
.expect_var_path("r_ref", type="TTT &&")
23 self
.assertEqual(rref_val
.Dereference().GetType().GetName(), "TTT")
25 # Typedef to a reference should dereference to the underlying type.
26 td_val
= self
.expect_var_path("td_to_ref_type", type="td_int_ref")
27 self
.assertEqual(td_val
.Dereference().GetType().GetName(), "int")