Skip to content

Add support for void* pointers in goto-harness #5290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 9, 2020
8 changes: 8 additions & 0 deletions regression/goto-harness/void-star-pointer/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#include <assert.h>
#include <stdbool.h>

void test_function(void *input)
{
assert(input == 0);
}

void test_void_array(void *input_array[10])
{
__CPROVER_assume(input_array != 0);
assert(input_array[0] == 0);
assert(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 A lot of tests forget this step

}
12 changes: 12 additions & 0 deletions regression/goto-harness/void-star-pointer/test-array.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CORE
main.c
--harness-type call-function --function test_void_array
\[test_void_array\.assertion\.1\] line \d+ assertion input_array\[0\] == 0: SUCCESS
\[test_void_array\.assertion\.2\] line \d+ assertion false: FAILURE
^VERIFICATION FAILED$
^EXIT=10$
^SIGNAL=0$
--
--
Ensure the harness is able to initalize an array of void* pointers where
the array is non-null, but the elements are null.