1"""
2Test the output of `frame diagnose` for dereferencing a local variable
3"""
4
5
6import lldb
7from lldbsuite.test.decorators import *
8from lldbsuite.test.lldbtest import *
9from lldbsuite.test import lldbutil
10
11
12class TestLocalVariable(TestBase):
13
14    @skipUnlessDarwin
15    @skipIf(archs=no_match(['x86_64']))  # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
16    def test_local_variable(self):
17        TestBase.setUp(self)
18        self.build()
19        exe = self.getBuildArtifact("a.out")
20        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
21        self.runCmd("run", RUN_SUCCEEDED)
22        self.expect("thread list", "Thread should be stopped",
23                    substrs=['stopped'])
24        self.expect("frame diagnose", "Crash diagnosis was accurate",
25                    substrs=["myInt"])
26