Skip to content

Commit c526ae2

Browse files
committed
Fixed goto-harness regressions
1 parent 181cb05 commit c526ae2

File tree

23 files changed

+33
-24
lines changed
  • regression/goto-harness
    • array-types
    • associated-size-parameter
    • do-not-use-nondet-for-recursion
    • do-not-use-nondet-for-selecting-pointers-to-treat-as-equal
    • mixed-constructors
    • nondet_elements_longer_lists
    • nondet_elements_longer_lists_global
    • nondet_initialize_static_arrays
    • nondet_strings
    • nondet_strings_should_only_have_zero_at_end
    • pointer-function-parameters-equal-maybe
    • pointer-function-parameters-equal-simple
    • pointer-function-parameters-struct-mutual-recursion
    • pointer-function-parameters-struct-non-recursive
    • pointer-function-parameters-struct-simple-recursion
    • pointer-function-parameters-struct-simple-recursion-2
    • pointer-to-array-function-parameters
    • pointer-to-array-function-parameters-max-size
    • pointer-to-array-function-parameters-min-size
    • pointer-to-array-function-parameters-multi-arg-right
    • pointer-to-array-function-parameters-with-size
    • recursive-structs-follow-new-tags-beyond-depth-limit

23 files changed

+33
-24
lines changed

Diff for: regression/goto-harness/array-types/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
example.c
3-
--harness-type call-function --function test --treat-pointer-as-array arr
3+
--harness-type call-function --function test --treat-pointer-as-array arr _ --no-standard-checks
44
VERIFICATION SUCCESSFUL
55
^EXIT=0$
66
^SIGNAL=0$

Diff for: regression/goto-harness/associated-size-parameter/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--harness-type call-function --function test --associated-array-size array:size
3+
--harness-type call-function --function test --associated-array-size array:size _ --no-standard-checks
44
VERIFICATION SUCCESSFUL
55
^EXIT=0$
66
^SIGNAL=0$

Diff for: regression/goto-harness/chain.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ else
2222
fi
2323

2424
args=${*:1:$#-1}
25-
25+
if [[ "$args" != *" _ "* ]]
26+
then
27+
args_harness=$args
28+
args_cbmc=""
29+
else
30+
args_harness="${args%%" _ "*}"
31+
args_cbmc="${args#*" _ "}"
32+
fi
2633

2734
cleanup()
2835
{
@@ -54,18 +61,20 @@ fi
5461

5562
# `# some comment` is an inline comment - basically, cause bash to execute an empty command
5663
$cbmc --show-goto-functions "$input_goto_binary"
57-
$goto_harness "$input_goto_binary" "$harness_file" --harness-function-name $entry_point ${args}
64+
$goto_harness "$input_goto_binary" "$harness_file" --harness-function-name $entry_point ${args_harness}
5865
$cbmc --show-goto-functions "$harness_file"
5966
if [[ "${harness_file}" == "harness.gb" ]];then
6067
$cbmc --function $entry_point "$harness_file" \
6168
--pointer-check `# because we want to see out of bounds errors` \
6269
--unwind 11 `# with the way we set up arrays symex can't figure out loop bounds automatically` \
6370
--unwinding-assertions `# we want to make sure we don't accidentally pass tests because we didn't unwind enough` \
71+
${args_cbmc} `# extra cbmc-related arguments` \
6472
# cbmc args end
6573
else
6674
$cbmc --function $entry_point "$input_c_file" "$harness_file" \
6775
--pointer-check `# because we want to see out of bounds errors` \
6876
--unwind 11 `# with the way we set up arrays symex can't figure out loop bounds automatically` \
6977
--unwinding-assertions `# we want to make sure we don't accidentally pass tests because we didn't unwind enough` \
78+
${args_cbmc} `# extra cbmc-related arguments` \
7079
# cbmc args end
7180
fi

Diff for: regression/goto-harness/do-not-use-nondet-for-recursion/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--function test --harness-type call-function
3+
--function test --harness-type call-function _ --no-standard-checks
44
\[test.assertion.1\] line \d+ assertion list: SUCCESS
55
\[test.assertion.2\] line \d+ assertion list->next: FAILURE
66
\[test.assertion.3\] line \d+ assertion !\(list->next != \(\(struct linked_list \*\).*\)\): FAILURE

Diff for: regression/goto-harness/do-not-use-nondet-for-selecting-pointers-to-treat-as-equal/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--function test --harness-type call-function --treat-pointers-equal x,y --treat-pointers-equal-maybe
3+
--function test --harness-type call-function --treat-pointers-equal x,y --treat-pointers-equal-maybe _ --no-standard-checks
44
should_make_equal
55
\[test.assertion.1\] line 3 assertion x: SUCCESS
66
\[test.assertion.2\] line 4 assertion y: SUCCESS

Diff for: regression/goto-harness/mixed-constructors/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--function entry_point --harness-type call-function --associated-array-size array_with_size:size
3+
--function entry_point --harness-type call-function --associated-array-size array_with_size:size _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
--

Diff for: regression/goto-harness/nondet_elements_longer_lists/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--harness-type call-function --max-nondet-tree-depth 4 --min-null-tree-depth 1 --function test_function
3+
--harness-type call-function --max-nondet-tree-depth 4 --min-null-tree-depth 1 --function test_function _ --no-standard-checks
44
\[test_function.assertion.\d+\] line \d+ assertion list_walker->datum == \+\+i: SUCCESS
55
^EXIT=0$
66
^SIGNAL=0$

Diff for: regression/goto-harness/nondet_elements_longer_lists_global/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--harness-type call-function --max-nondet-tree-depth 4 --min-null-tree-depth 1 --function test_function --nondet-globals
3+
--harness-type call-function --max-nondet-tree-depth 4 --min-null-tree-depth 1 --function test_function --nondet-globals _ --no-standard-checks
44
\[test_function.assertion.\d+\] line \d+ assertion list_walker->datum == \+\+i: SUCCESS
55
^EXIT=0$
66
^SIGNAL=0$

Diff for: regression/goto-harness/nondet_initialize_static_arrays/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 4 --harness-type call-function
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 4 --harness-type call-function _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

Diff for: regression/goto-harness/nondet_strings/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--harness-type call-function --function function --treat-pointer-as-cstring pointer --associated-array-size pointer:size
3+
--harness-type call-function --function function --treat-pointer-as-cstring pointer --associated-array-size pointer:size _ --no-standard-checks
44
\[function.assertion.\d+\] line \d+ assertion pointer\[size - 1\] == \'\\0\': SUCCESS
55
^VERIFICATION SUCCESSFUL$
66
^EXIT=0$

Diff for: regression/goto-harness/nondet_strings_should_only_have_zero_at_end/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--harness-type call-function --function calling_func --treat-pointer-as-cstring s --associated-array-size s:length
3+
--harness-type call-function --function calling_func --treat-pointer-as-cstring s --associated-array-size s:length _ --no-standard-checks
44
\[calling_func.assertion.\d+\] line \d+ assertion stringlength\(s\) \+ 1 == length: SUCCESS
55
^VERIFICATION SUCCESSFUL$
66
^EXIT=0$

Diff for: regression/goto-harness/pointer-function-parameters-equal-maybe/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function --treat-pointers-equal 'p,q;r,s,t' --treat-pointers-equal-maybe
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function --treat-pointers-equal 'p,q;r,s,t' --treat-pointers-equal-maybe _ --no-standard-checks
44
^EXIT=10$
55
^SIGNAL=0$
66
^\[func.assertion.\d+\] line \d+ assertion p == q: FAILURE$

Diff for: regression/goto-harness/pointer-function-parameters-equal-simple/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function --treat-pointers-equal 'p,q;r,s,t'
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function --treat-pointers-equal 'p,q;r,s,t' _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

Diff for: regression/goto-harness/pointer-function-parameters-struct-mutual-recursion/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

Diff for: regression/goto-harness/pointer-function-parameters-struct-non-recursive/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --harness-type call-function
3+
--function func --min-null-tree-depth 10 --harness-type call-function _ --no-standard-checks
44
^EXIT=10$
55
^SIGNAL=0$
66
\[func.assertion.1\] line [0-9]+ assertion p != .*((NULL)|0).*: SUCCESS

Diff for: regression/goto-harness/pointer-function-parameters-struct-simple-recursion-2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 2 --harness-type call-function
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 2 --harness-type call-function _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

Diff for: regression/goto-harness/pointer-function-parameters-struct-simple-recursion/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 3 --harness-type call-function _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

Diff for: regression/goto-harness/pointer-to-array-function-parameters-max-size/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--harness-type call-function --function test --max-array-size 10 --associated-array-size arr:sz
3+
--harness-type call-function --function test --max-array-size 10 --associated-array-size arr:sz _ --no-standard-checks
44
\[test.assertion.1\] line \d+ assertion sz < 10: FAILURE
55
\[test.pointer_dereference.\d+\] line \d+ dereference failure: pointer NULL in arr\[(\(signed( long)* int\))?i\]: SUCCESS
66
\[test.pointer_dereference.\d+\] line \d+ dereference failure: pointer invalid in arr\[(\(signed( long)* int\))?i\]: SUCCESS

Diff for: regression/goto-harness/pointer-to-array-function-parameters-min-size/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--harness-type call-function --function min_array_size_test --max-array-size 3 --min-array-size 3 --associated-array-size arr:sz
3+
--harness-type call-function --function min_array_size_test --max-array-size 3 --min-array-size 3 --associated-array-size arr:sz _ --no-standard-checks
44
VERIFICATION SUCCESSFUL
55
^EXIT=0$
66
^SIGNAL=0$

Diff for: regression/goto-harness/pointer-to-array-function-parameters-multi-arg-right/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--harness-type call-function --function is_prefix_of --treat-pointer-as-array string --treat-pointer-as-array prefix --associated-array-size string:string_size --associated-array-size prefix:prefix_size --max-array-size 5
3+
--harness-type call-function --function is_prefix_of --treat-pointer-as-array string --treat-pointer-as-array prefix --associated-array-size string:string_size --associated-array-size prefix:prefix_size --max-array-size 5 _ --no-standard-checks
44
^SIGNAL=0$
55
^EXIT=0$
66
VERIFICATION SUCCESSFUL

Diff for: regression/goto-harness/pointer-to-array-function-parameters-with-size/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--harness-type call-function --function test --treat-pointer-as-array arr --associated-array-size arr:sz
3+
--harness-type call-function --function test --treat-pointer-as-array arr --associated-array-size arr:sz _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
\[test.pointer_dereference.1\] line \d+ dereference failure: pointer NULL in arr\[(\(signed( long)* int\))?i\]: SUCCESS

Diff for: regression/goto-harness/pointer-to-array-function-parameters/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.c
3-
--harness-type call-function --function test --treat-pointer-as-array arr
3+
--harness-type call-function --function test --treat-pointer-as-array arr _ --no-standard-checks
44
\[test.pointer_dereference.\d+\] line \d+ dereference failure: pointer outside object bounds in arr\[(\(signed( long)* int\))?0\]: SUCCESS
55
\[test.pointer_dereference.\d+\] line \d+ dereference failure: pointer outside object bounds in arr\[(\(signed( long)* int\))?10\]: FAILURE
66
^EXIT=10$

Diff for: regression/goto-harness/recursive-structs-follow-new-tags-beyond-depth-limit/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 1 --harness-type call-function
3+
--function func --min-null-tree-depth 10 --max-nondet-tree-depth 1 --harness-type call-function _ --no-standard-checks
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

0 commit comments

Comments
 (0)