[LoopInterchange] Hoist isComputableLoopNest() in the control flow (#124247)
[llvm-project.git] / lldb / test / API / commands / expression / po_persistent_result / TestPoPersistentResult.py
bloba5b48a1bf3972d2f03a37a21d89c1e45390e087a
1 """
2 Test behavior of `po` and persistent results.
3 """
5 import lldb
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test import lldbutil
11 class TestCase(TestBase):
12 def setUp(self):
13 TestBase.setUp(self)
14 self.build()
15 lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))
17 @skipUnlessDarwin
18 def test_po_does_not_print_persistent_result(self):
19 """Test `po` doesn't advertise a persistent result variable."""
20 self.expect("po obj", matching=False, substrs=["$0 = "])
22 @skipUnlessDarwin
23 def test_po_does_not_keep_persistent_result(self):
24 """Test `po` doesn't leak a persistent result variable."""
25 self.expect("po obj")
26 # Verify `po` used a temporary persistent result. In other words, there
27 # should be no $0 at this point.
28 self.expect("expression $0", error=True)
29 self.expect("expression obj", substrs=["$0 = "])
31 @skipUnlessDarwin
32 def test_expression_description_verbosity(self):
33 """Test printing object description _and_ opt-in to persistent results."""
34 self.expect("expression -O -vfull -- obj", substrs=["$0 = "])
35 self.expect("expression $0", substrs=["$0 = "])