summaryrefslogtreecommitdiffstats
path: root/lldb/test/Shell/ScriptInterpreter/Lua
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-21 14:58:50 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-21 15:00:35 -0800
commit4164be7206d740b77b5a7b4b2f859ed122d08c10 (patch)
tree36221f6baeca0eea6e416ad95a6420a093892a03 /lldb/test/Shell/ScriptInterpreter/Lua
parentceb433ad162bac35888303d29d34dc2609974d92 (diff)
downloadbcm5719-llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.tar.gz
bcm5719-llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.zip
[Lldb/Lua] Persist Lua state across script interpreter calls.
Don't create a new lua state on every operation. Share a single state across the lifetime of the script interpreter. Add simple locking to prevent two threads from modifying the state concurrently.
Diffstat (limited to 'lldb/test/Shell/ScriptInterpreter/Lua')
-rw-r--r--lldb/test/Shell/ScriptInterpreter/Lua/persistent_state.test3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/persistent_state.test b/lldb/test/Shell/ScriptInterpreter/Lua/persistent_state.test
new file mode 100644
index 00000000000..4cdea152fda
--- /dev/null
+++ b/lldb/test/Shell/ScriptInterpreter/Lua/persistent_state.test
@@ -0,0 +1,3 @@
+# REQUIRES: lua
+# RUN: %lldb --script-language lua -o 'script foo = 1010' -o 'script bar = 101' -o 'script print(foo+bar)' 2>&1 | FileCheck %s
+# CHECK: 1111
OpenPOWER on IntegriCloud