1"""
2Tests calling builtin functions using expression evaluation.
3"""
4
5
6
7import lldb
8from lldbsuite.test.decorators import *
9from lldbsuite.test.lldbtest import *
10from lldbsuite.test import lldbutil
11
12
13class ExprCommandCallBuiltinFunction(TestBase):
14
15    mydir = TestBase.compute_mydir(__file__)
16
17    # Builtins are expanded by Clang, so debug info shouldn't matter.
18    NO_DEBUG_INFO_TESTCASE = True
19
20    def test(self):
21        self.build()
22
23        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
24
25        self.expect_expr("__builtin_isinf(0.0f)", result_type="int", result_value="0")
26        self.expect_expr("__builtin_isnormal(0.0f)", result_type="int", result_value="0")
27        self.expect_expr("__builtin_constant_p(1)", result_type="int", result_value="1")
28        self.expect_expr("__builtin_abs(-14)", result_type="int", result_value="14")
29