57c04b215e9773f028202127b5f7cf8b87df1979
[openbsd] /
1 """
2 Test that lldb persistent variables works correctly.
3 """
4
5
6
7 import lldb
8 from lldbsuite.test.lldbtest import *
9
10
11 class PersistentVariablesTestCase(TestBase):
12
13     mydir = TestBase.compute_mydir(__file__)
14
15     def test_persistent_variables(self):
16         """Test that lldb persistent variables works correctly."""
17         self.build()
18
19         self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
20
21         self.runCmd("breakpoint set --source-pattern-regexp break")
22
23         self.runCmd("run", RUN_SUCCEEDED)
24
25         self.runCmd("expression int $i = i")
26
27         self.expect("expression $i == i",
28                     startstr="(bool) $0 = true")
29
30         self.expect("expression $i + 1",
31                     startstr="(int) $1 = 6")
32
33         self.expect("expression $i + 3",
34                     startstr="(int) $2 = 8")
35
36         self.expect("expression $2 + $1",
37                     startstr="(int) $3 = 14")
38
39         self.expect("expression $3",
40                     startstr="(int) $3 = 14")
41
42         self.expect("expression $2",
43                     startstr="(int) $2 = 8")
44
45         self.expect("expression (int)-2",
46                     startstr="(int) $4 = -2")
47
48         self.expect("expression $4 > (int)31",
49                     startstr="(bool) $5 = false")
50
51         self.expect("expression (long)$4",
52                     startstr="(long) $6 = -2")