summaryrefslogtreecommitdiffstats
path: root/lldb/test/expression_command/persistent_variables
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/expression_command/persistent_variables')
-rw-r--r--lldb/test/expression_command/persistent_variables/TestPersistentVariables.py25
-rw-r--r--lldb/test/expression_command/persistent_variables/main.c3
2 files changed, 17 insertions, 11 deletions
diff --git a/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py b/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py
index 47d1631d7c2..51c22aa9c52 100644
--- a/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py
+++ b/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py
@@ -17,28 +17,33 @@ class PersistentVariablesTestCase(TestBase):
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- self.runCmd("breakpoint set --name main")
+ self.runCmd("breakpoint set --source-pattern-regexp break")
self.runCmd("run", RUN_SUCCEEDED)
- self.expect("expression int $i = 5; $i + 1",
- startstr = "(int) $0 = 6")
+ self.runCmd("expression int $i = i")
+
+ self.expect("expression $i == i",
+ startstr = "(bool) $0 = true")
+
+ self.expect("expression $i + 1",
+ startstr = "(int) $1 = 6")
# (int) $0 = 6
self.expect("expression $i + 3",
- startstr = "(int) $1 = 8")
+ startstr = "(int) $2 = 8")
# (int) $1 = 8
- self.expect("expression $1 + $0",
- startstr = "(int) $2 = 14")
+ self.expect("expression $2 + $1",
+ startstr = "(int) $3 = 14")
# (int) $2 = 14
- self.expect("expression $2",
- startstr = "(int) $2 = 14")
+ self.expect("expression $3",
+ startstr = "(int) $3 = 14")
# (int) $2 = 14
- self.expect("expression $1",
- startstr = "(int) $1 = 8")
+ self.expect("expression $2",
+ startstr = "(int) $2 = 8")
# (int) $1 = 8
diff --git a/lldb/test/expression_command/persistent_variables/main.c b/lldb/test/expression_command/persistent_variables/main.c
index 343eac7e554..fd41471df8e 100644
--- a/lldb/test/expression_command/persistent_variables/main.c
+++ b/lldb/test/expression_command/persistent_variables/main.c
@@ -9,5 +9,6 @@
int main (int argc, char const *argv[])
{
- return 0;
+ int i = 5;
+ return 0; // Set breakpoint here
}
OpenPOWER on IntegriCloud