File tree Expand file tree Collapse file tree 6 files changed +91
-0
lines changed
identifier_names_illegal_characters Expand file tree Collapse file tree 6 files changed +91
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ add_subdirectory(smt2_strings)
3838add_subdirectory (strings )
3939add_subdirectory (invariants)
4040add_subdirectory (goto-diff)
41+ add_subdirectory (goto-cc-instrument-cbmc)
4142add_subdirectory (test -script)
4243add_subdirectory (goto-analyzer-taint)
4344if (NOT WIN32 )
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+ "${CMAKE_CURRENT_SOURCE_DIR} /chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:cbmc> $<TARGET_FILE:goto-instrument> ${is_windows} "
9+ )
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+ ifeq ($(BUILD_ENV_ ) ,MSVC)
7+ exe=../../../src/goto-cc/goto-cl
8+ is_windows=true
9+ else
10+ exe=../../../src/goto-cc/goto-cc
11+ is_windows=false
12+ endif
13+
14+ cbmc =../../../src/cbmc/cbmc
15+ goto-instrument =../../../src/goto-instrument/goto-instrument
16+
17+ test :
18+ @../test.pl -e -p -c ' ../chain.sh $(exe) $(cbmc) $(goto-instrument) $(is_windows)'
19+
20+ tests.log :
21+ @../test.pl -e -p -c ' ../chain.sh $(exe) $(cbmc) $(goto-instrument) $(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+ @for dir in * ; do \
32+ $(RM ) tests.log; \
33+ if [ -d " $$ dir" ]; then \
34+ cd " $$ dir" ; \
35+ $(RM ) * .out * .gb; \
36+ cd ..; \
37+ fi \
38+ done
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ goto_cc=$1
4+ cbmc=$2
5+ goto_instrument=$3
6+ is_windows=$4
7+
8+ name=${*: $# }
9+ base_name=${name% .c}
10+ modified_name=${base_name} .modified.c
11+
12+ if [[ " ${is_windows} " == " true" ]]; then
13+ " ${goto_cc} " " ${name} "
14+ mv " ${base_name} .exe" " ${base_name} .gb"
15+ else
16+ " ${goto_cc} " " ${name} " -o " ${base_name} .gb"
17+ fi
18+
19+ " ${goto_instrument} " " ${base_name} .gb" --dump-c " ${modified_name} "
20+
21+ " ${cbmc} " " ${modified_name} "
Original file line number Diff line number Diff line change 1+ int main (void )
2+ {
3+ void * v , * x , * x_before ;
4+ x_before = x ;
5+ __atomic_store_n (& x , 42 , 0 );
6+ __atomic_exchange_n (& x , 42 , 0 );
7+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ test.c
3+
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
7+ --
8+ ^PARSING ERROR$
9+ ^CONVERSION ERROR$
10+ --
11+ Example of an illegal identifier name we crashed on before:
12+ __atomic_compare_exchange_n_*{V}$V$
13+
14+ Example of the substitutes we are producing now.
15+ __atomic_compare_exchange__ptr__start_sub_V_end_sub_
You can’t perform that action at this time.
0 commit comments