Skip to content

Commit afa2520

Browse files
committed
Add test for decision procedure support of function pointers
1 parent 51b641d commit afa2520

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

unit/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,30 @@ TEST_CASE(
731731
REQUIRE(test.sent_commands == expected_commands);
732732
}
733733

734+
TEST_CASE(
735+
"smt2_incremental_decision_proceduret function pointer support.",
736+
"[core][smt2_incremental]")
737+
{
738+
auto test = decision_procedure_test_environmentt::make();
739+
const code_typet function_type{{}, void_type()};
740+
const symbolt function{"opaque", function_type, ID_C};
741+
test.symbol_table.insert(function);
742+
const address_of_exprt function_pointer{function.symbol_expr()};
743+
const equal_exprt equals_null{
744+
function_pointer, null_pointer_exprt{pointer_typet{function_type, 32}}};
745+
746+
test.sent_commands.clear();
747+
test.procedure.set_to(equals_null, false);
748+
749+
const std::vector<smt_commandt> expected_commands{
750+
smt_assert_commandt{smt_core_theoryt::make_not(smt_core_theoryt::equal(
751+
smt_bit_vector_theoryt::concat(
752+
smt_bit_vector_constant_termt{2, 8},
753+
smt_bit_vector_constant_termt{0, 24}),
754+
smt_bit_vector_constant_termt{0, 32}))}};
755+
REQUIRE(test.sent_commands == expected_commands);
756+
}
757+
734758
TEST_CASE(
735759
"smt2_incremental_decision_proceduret multi-ary with_exprt introduces "
736760
"correct number of indexes.",

0 commit comments

Comments
 (0)