Skip to content

Commit 3b7e4ab

Browse files
committed
Add test for fixing of referencing of static symbols in harness file.
1 parent d8ad34f commit 3b7e4ab

File tree

7 files changed

+53
-0
lines changed

7 files changed

+53
-0
lines changed

regression/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ add_subdirectory(statement-list)
5353
add_subdirectory(systemc)
5454
add_subdirectory(contracts)
5555
add_subdirectory(goto-harness)
56+
add_subdirectory(goto-harness-gb-input)
5657
add_subdirectory(goto-harness-multi-file-project)
5758
add_subdirectory(goto-cc-file-local)
5859
add_subdirectory(goto-cc-regression-gh-issue-5380)

regression/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DIRS = cbmc \
2020
goto-analyzer-taint \
2121
goto-gcc \
2222
goto-harness \
23+
goto-harness-gb-input \
2324
goto-cl \
2425
goto-cc-cbmc \
2526
cbmc-cpp \
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
add_test_pl_tests(
2+
"../chain.sh \
3+
$<TARGET_FILE:goto-harness> \
4+
$<TARGET_FILE:cbmc>")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
default: tests.log
2+
3+
include ../../src/config.inc
4+
include ../../src/common
5+
6+
GOTO_HARNESS_EXE=../../../src/goto-harness/goto-harness
7+
CBMC_EXE=../../../src/cbmc/cbmc
8+
9+
test:
10+
@../test.pl -e -p -c "../chain.sh $(GOTO_HARNESS_EXE) $(CBMC_EXE)"
11+
12+
tests.log: ../test.pl
13+
@../test.pl -e -p -c "../chain.sh $(GOTO_HARNESS_EXE) $(CBMC_EXE)"
14+
15+
clean:
16+
find -name '*.out' -execdir $(RM) '{}' \;
17+
find -name '*.gb' -execdir $(RM) {} \;
18+
$(RM) tests.log
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
goto_harness=$1
6+
cbmc=$2
7+
8+
input_goto_binary=${*:$#}
9+
args=${*:3:$#-3}
10+
harness_c_file="generated-harness-file.c"
11+
entry_point='generated_harness_test_function'
12+
13+
if [ -e "$harness_c_file" ]; then
14+
rm -rf "$harness_c_file"
15+
fi
16+
17+
$goto_harness "$input_goto_binary" "$harness_c_file" ${args}
18+
$cbmc "$harness_c_file"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
aws_byte_buf_append_harness.goto
3+
--harness-type call-function --harness-function-name generated_harness_test_function --function aws_byte_buf_append
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
--
7+
^CONVERSION ERROR$
8+
--
9+
For this particular error, we care mostly that goto-harness
10+
doesn't reference static symbols in other files, which would
11+
cause analysis through CBMC to fail with a conversion error

0 commit comments

Comments
 (0)