Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / functionalities / location-list-lookup / TestLocationListLookup.py
blob4793447c59413290f2545bdd00ff7e9acad5d3a5
1 """Test that lldb picks the correct DWARF location list entry with a return-pc out of bounds."""
3 import lldb
4 from lldbsuite.test.decorators import *
5 from lldbsuite.test.lldbtest import *
6 from lldbsuite.test import lldbutil
9 class LocationListLookupTestCase(TestBase):
10 def setUp(self):
11 # Call super's setUp().
12 TestBase.setUp(self)
14 @skipIf(oslist=["linux"], archs=["arm"])
15 def test_loclist(self):
16 self.build()
17 exe = self.getBuildArtifact("a.out")
19 # Create a target by the debugger.
20 target = self.dbg.CreateTarget(exe)
21 self.assertTrue(target, VALID_TARGET)
22 self.dbg.SetAsync(False)
24 li = lldb.SBLaunchInfo(["a.out"])
25 error = lldb.SBError()
26 process = target.Launch(li, error)
27 self.assertTrue(process.IsValid())
28 self.assertTrue(process.is_stopped)
30 # Find `main` on the stack, then
31 # find `argv` local variable, then
32 # check that we can read the c-string in argv[0]
33 for f in process.GetSelectedThread().frames:
34 if f.GetDisplayFunctionName() == "main":
35 argv = f.GetValueForVariablePath("argv").GetChildAtIndex(0)
36 strm = lldb.SBStream()
37 argv.GetDescription(strm)
38 self.assertNotEqual(strm.GetData().find("a.out"), -1)