[mlir][acc] Introduce MappableType interface (#122146)
[llvm-project.git] / lldb / test / API / lang / cpp / dereferencing_references / TestCPPDereferencingReferences.py
blob938fb1a6edf32cdeccf2dc05cc490795ba8dd321
1 import lldb
2 from lldbsuite.test.decorators import *
3 from lldbsuite.test.lldbtest import *
4 from lldbsuite.test import lldbutil
7 class TestCase(TestBase):
8 def test(self):
9 """Tests deferencing lvalue/rvalue references via LLDB's builtin type system."""
10 self.build()
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
17 # 'int').
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")