summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
commit061da546b983eb767bad15e67af1174fb0bcf31c (patch)
tree83c78b820819d70aa40c36d90447978b300078c5 /gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int
parentImport LLVM 10.0.0 release including clang, lld and lldb. (diff)
downloadwireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.tar.xz
wireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.zip
Import LLVM 10.0.0 release including clang, lld and lldb.
ok hackroom tested by plenty
Diffstat (limited to 'gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int')
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/Makefile3
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/TestGetValue32BitInt.py19
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/main.cpp5
3 files changed, 27 insertions, 0 deletions
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/Makefile b/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/Makefile
new file mode 100644
index 00000000000..99998b20bcb
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/Makefile
@@ -0,0 +1,3 @@
+CXX_SOURCES := main.cpp
+
+include Makefile.rules
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/TestGetValue32BitInt.py b/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/TestGetValue32BitInt.py
new file mode 100644
index 00000000000..025226471bd
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/TestGetValue32BitInt.py
@@ -0,0 +1,19 @@
+"""
+Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1.
+"""
+
+import lldb
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+class TestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_with_run_command(self):
+ self.build()
+ lldbutil.run_to_source_breakpoint(self,"// break here", lldb.SBFileSpec("main.cpp"))
+
+ self.assertEqual(self.frame().FindVariable("myvar").GetValueAsSigned(), -1)
+ self.assertEqual(self.frame().FindVariable("myvar").GetValueAsUnsigned(), 0xFFFFFFFF)
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/main.cpp b/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/main.cpp
new file mode 100644
index 00000000000..61f40fb2a78
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/python_api/get-value-32bit-int/main.cpp
@@ -0,0 +1,5 @@
+#include <cstdint>
+int main () {
+ int32_t myvar = -1;
+ return myvar; // break here
+}