xref: /llvm-project/lldb/test/API/commands/expression/call-function/TestCallBuiltinFunction.py (revision 34ee53c9e390019d757b453ceba9cc3e47ab0df1)
199451b44SJordan Rupprecht"""
299451b44SJordan RupprechtTests calling builtin functions using expression evaluation.
399451b44SJordan Rupprecht"""
499451b44SJordan Rupprecht
599451b44SJordan Rupprecht
699451b44SJordan Rupprechtimport lldb
799451b44SJordan Rupprechtfrom lldbsuite.test.decorators import *
899451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import *
999451b44SJordan Rupprechtfrom lldbsuite.test import lldbutil
1099451b44SJordan Rupprecht
1199451b44SJordan Rupprecht
1299451b44SJordan Rupprechtclass ExprCommandCallBuiltinFunction(TestBase):
1399451b44SJordan Rupprecht    # Builtins are expanded by Clang, so debug info shouldn't matter.
1499451b44SJordan Rupprecht    NO_DEBUG_INFO_TESTCASE = True
1599451b44SJordan Rupprecht
1699451b44SJordan Rupprecht    def test(self):
1799451b44SJordan Rupprecht        self.build()
1899451b44SJordan Rupprecht
1954c26872SRaphael Isemann        target = self.createTestTarget()
2099451b44SJordan Rupprecht
2199451b44SJordan Rupprecht        self.expect_expr("__builtin_isinf(0.0f)", result_type="int", result_value="0")
22*2238dcc3SJonas Devlieghere        self.expect_expr(
23*2238dcc3SJonas Devlieghere            "__builtin_isnormal(0.0f)", result_type="int", result_value="0"
24*2238dcc3SJonas Devlieghere        )
2599451b44SJordan Rupprecht        self.expect_expr("__builtin_constant_p(1)", result_type="int", result_value="1")
26