File tree Expand file tree Collapse file tree 10 files changed +105
-0
lines changed Expand file tree Collapse file tree 10 files changed +105
-0
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,4 @@ add_subdirectory(systemc)
5151add_subdirectory (contracts)
5252add_subdirectory (goto-harness)
5353add_subdirectory (goto-cc-file-local)
54+ add_subdirectory (linking-goto-binaries)
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ DIRS = cbmc \
2626 systemc \
2727 contracts \
2828 goto-cc-file-local \
29+ linking-goto-binaries \
2930 # Empty last line
3031
3132# Run all test directories in sequence
Original file line number Diff line number Diff line change 1+ if (WIN32 )
2+ set (is_windows true )
3+ else ()
4+ set (is_windows false )
5+ endif ()
6+
7+ add_test_pl_tests(
8+ "../chain.sh \
9+ $<TARGET_FILE:goto-cc> \
10+ $<TARGET_FILE:cbmc> \
11+ ${is_windows} " )
Original file line number Diff line number Diff line change 1+ default : tests.log
2+
3+ include ../../src/config.inc
4+ include ../../src/common
5+
6+ GOTO_CC_EXE =../../../src/goto-cc/goto-cc
7+ CBMC_EXE =../../../src/cbmc/cbmc
8+
9+ ifeq ($(BUILD_ENV_ ) ,MSVC)
10+ GOTO_CC_EXE=../../../src/goto-cc/goto-cl
11+ is_windows=true
12+ else
13+ GOTO_CC_EXE=../../../src/goto-cc/goto-cc
14+ is_windows=false
15+ endif
16+
17+ test :
18+ @../test.pl -e -p -c " ../chain.sh $( GOTO_CC_EXE) $( CBMC_EXE) $( is_windows) "
19+
20+ tests.log : ../test.pl
21+ @../test.pl -e -p -c " ../chain.sh $( GOTO_CC_EXE) $( CBMC_EXE) $( is_windows) "
22+
23+ show :
24+ @for dir in * ; do \
25+ if [ -d " $$ dir" ]; then \
26+ vim -o " $$ dir/*.c" " $$ dir/*.out" ; \
27+ fi ; \
28+ done ;
29+
30+ clean :
31+ find -name ' *.out' -execdir $(RM ) ' {}' \;
32+ find -name ' *.gb' -execdir $(RM ) {} \;
33+ $(RM ) tests.log
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ goto_cc=$1
6+ cbmc=$2
7+ is_windows=$3
8+ entry_point=' generated_entry_function'
9+
10+ main=${*: $# }
11+ main=${main% .c}
12+ args=${*: 4: $# -4}
13+ next=${args% .c}
14+
15+ if [[ " ${is_windows} " == " true" ]]; then
16+ $goto_cc " ${main} .c"
17+ $goto_cc " ${next} .c"
18+ mv " ${main} .exe" " ${main} .gb"
19+ mv " ${next} .exe" " ${next} .gb"
20+ else
21+ $goto_cc -o " ${main} .gb" " ${main} .c"
22+ $goto_cc -o " ${next} .gb" " ${next} .c"
23+ fi
24+
25+ $cbmc " ${main} .gb" " ${next} .gb"
Original file line number Diff line number Diff line change 1+ #include "supp.h"
2+ #include <assert.h>
3+
4+ const int five = 5 ;
5+
6+ int main ()
7+ {
8+ int ten = times_two (five );
9+ assert (ten == 10 );
10+ return 0 ;
11+ }
Original file line number Diff line number Diff line change 1+ #include "supp.h"
2+
3+ int times_two (int i )
4+ {
5+ return 2 * i ;
6+ }
Original file line number Diff line number Diff line change 1+ #ifndef SUPP_H
2+ #define SUPP_H
3+
4+ int times_two (int i );
5+
6+ #endif // SUPP_H
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ supp.c
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ \[main.assertion.1\] line [0-9]+ assertion ten == 10: SUCCESS
7+ ^VERIFICATION SUCCESSFUL$
8+ --
9+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ static bool link_functions(
9797 rename_symbols_in_function (src_func, final_id, rename_symbol);
9898
9999 in_dest_symbol_table.body .swap (src_func.body );
100+ in_dest_symbol_table.parameter_identifiers .swap (
101+ src_func.parameter_identifiers );
100102 in_dest_symbol_table.type =src_func.type ;
101103 }
102104 else if (src_func.body .instructions .empty () ||
You can’t perform that action at this time.
0 commit comments