summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/expression_command/call-function
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/expression_command/call-function')
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallBuiltinFunction.py53
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py4
3 files changed, 53 insertions, 9 deletions
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallBuiltinFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallBuiltinFunction.py
new file mode 100644
index 000000000000..87787f3479a2
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallBuiltinFunction.py
@@ -0,0 +1,53 @@
+"""
+Tests calling builtin functions using expression evaluation.
+"""
+
+from __future__ import print_function
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class ExprCommandCallBuiltinFunction(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ # Builtins are expanded by Clang, so debug info shouldn't matter.
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def setUp(self):
+ TestBase.setUp(self)
+ # Find the line number to break for main.c.
+ self.line = line_number(
+ 'main.cpp',
+ '// Please test these expressions while stopped at this line:')
+
+ def test(self):
+ self.build()
+
+ # Set breakpoint in main and run exe
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ interp = self.dbg.GetCommandInterpreter()
+ result = lldb.SBCommandReturnObject()
+
+ # Test different builtin functions.
+
+ interp.HandleCommand("expr __builtin_isinf(0.0f)", result)
+ self.assertEqual(result.GetOutput(), "(int) $0 = 0\n")
+
+ interp.HandleCommand("expr __builtin_isnormal(0.0f)", result)
+ self.assertEqual(result.GetOutput(), "(int) $1 = 0\n")
+
+ interp.HandleCommand("expr __builtin_constant_p(1)", result)
+ self.assertEqual(result.GetOutput(), "(int) $2 = 1\n")
+
+ interp.HandleCommand("expr __builtin_abs(-14)", result)
+ self.assertEqual(result.GetOutput(), "(int) $3 = 14\n")
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
index 63511779a927..d832983bdb64 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
@@ -6,7 +6,6 @@ from __future__ import print_function
import lldb
-from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@@ -24,10 +23,6 @@ class ExprCommandCallStopContinueTestCase(TestBase):
'// Please test these expressions while stopped at this line:')
self.func_line = line_number('main.cpp', '{5, "five"}')
- @expectedFlakeyDarwin("llvm.org/pr20274")
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test(self):
"""Test gathering result from interrupted function call."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
index ff3bd99ced99..0eb7086b6160 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -28,10 +28,6 @@ class ExprCommandCallUserDefinedFunction(TestBase):
'main.cpp',
'// Please test these expressions while stopped at this line:')
- @expectedFlakeyDsym("llvm.org/pr20274")
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test(self):
"""Test return values of user defined function calls."""
self.build()