forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
263 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.2) | ||
|
||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) | ||
|
||
include(GNUInstallDirs) | ||
|
||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
add_subdirectory(src) | ||
|
||
enable_testing() | ||
set(enable_cbmc_tests on CACHE BOOL "Whether CBMC tests should be enabled") | ||
|
||
if(${enable_cbmc_tests}) | ||
enable_testing() | ||
endif() | ||
add_subdirectory(unit) | ||
add_subdirectory(regression) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED true) | ||
|
||
set(test_pl_path "${CMAKE_CURRENT_SOURCE_DIR}/test.pl") | ||
|
||
macro(add_test_pl_profile name cmdline flag profile) | ||
add_test( | ||
NAME "${name}-${profile}" | ||
COMMAND ${test_pl_path} -c ${cmdline} ${flag} | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
set_tests_properties("${name}-${profile}" PROPERTIES | ||
LABELS "${profile}" | ||
) | ||
endmacro(add_test_pl_profile) | ||
|
||
macro(add_test_pl_tests name cmdline) | ||
add_test_pl_profile("${name}" "${cmdline}" -C CORE) | ||
add_test_pl_profile("${name}" "${cmdline}" -T THOROUGH) | ||
add_test_pl_profile("${name}" "${cmdline}" -F FUTURE) | ||
add_test_pl_profile("${name}" "${cmdline}" -K KNOWNBUG) | ||
endmacro(add_test_pl_tests) | ||
|
||
add_subdirectory(ansi-c) | ||
add_subdirectory(cbmc) | ||
add_subdirectory(cbmc-java) | ||
add_subdirectory(cbmc-java-inheritance) | ||
add_subdirectory(cpp) | ||
add_subdirectory(goto-analyzer) | ||
add_subdirectory(goto-diff) | ||
add_subdirectory(goto-instrument) | ||
add_subdirectory(goto-instrument-typedef) | ||
add_subdirectory(invariants) | ||
add_subdirectory(strings) | ||
add_subdirectory(strings-smoke-tests) | ||
add_subdirectory(test-script) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"ansi-c" | ||
"$<TARGET_FILE:goto-cc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"cbmc-java-inheritance" | ||
"$<TARGET_FILE:cbmc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"cbmc-java" | ||
"$<TARGET_FILE:cbmc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"cbmc" | ||
"$<TARGET_FILE:cbmc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"cpp" | ||
"$<TARGET_FILE:goto-cc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"goto-analyzer" | ||
"$<TARGET_FILE:goto-analyzer>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"goto-diff" | ||
"$<TARGET_FILE:goto-diff>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if(WIN32) | ||
set(is_windows true) | ||
else() | ||
set(is_windows false) | ||
endif() | ||
|
||
add_test_pl_tests( | ||
"goto-instrument-typedef" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-instrument> ${is_windows}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
#!/bin/bash | ||
|
||
SRC=../../../src | ||
GC=$1 | ||
GI=$2 | ||
is_windows=$3 | ||
|
||
GC=$SRC/goto-cc/goto-cc | ||
GI=$SRC/goto-instrument/goto-instrument | ||
name=${*:$#} | ||
name=${name%.c} | ||
|
||
OPTS=$1 | ||
NAME=${2%.c} | ||
args=${*:4:$#-4} | ||
|
||
rm $NAME.gb | ||
$GC $NAME.c --function fun -o $NAME.gb | ||
echo $GI $OPTS $NAME.gb | ||
$GI $OPTS $NAME.gb | ||
rm "${name}.gb" | ||
if [[ "${is_windows}" == "true" ]]; then | ||
"$GC" "${name}.c" --function fun | ||
mv "${name}.exe" "${name}.gb" | ||
else | ||
"$GC" "${name}.c" --function fun -o "${name}.gb" | ||
fi | ||
|
||
echo "$GI" ${args} "${name}.gb" | ||
"$GI" ${args} "${name}.gb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if(WIN32) | ||
set(is_windows true) | ||
else() | ||
set(is_windows false) | ||
endif() | ||
|
||
add_test_pl_tests( | ||
"goto-instrument" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-instrument> $<TARGET_FILE:cbmc> ${is_windows}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
add_executable(driver driver.cpp) | ||
target_link_libraries(driver big-int util) | ||
|
||
add_test_pl_tests( | ||
"invariants" | ||
"$<TARGET_FILE:driver>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"strings-smoke-test" | ||
"$<TARGET_FILE:cbmc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"strings" | ||
"$<TARGET_FILE:cbmc>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_test_pl_tests( | ||
"test-script" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/program_runner.sh" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
for var in "$@"; do | ||
cp "${var}" __libcheck.c | ||
sed -i 's/__builtin_[^v]/s&/' __libcheck.c | ||
sed -i 's/__sync_/s&/' __libcheck.c | ||
sed -i 's/__noop/s&/' __libcheck.c | ||
cc -std=gnu99 -E -include library/cprover.h -D__CPROVER_bool=_Bool -D__CPROVER_thread_local=__thread -DLIBRARY_CHECK -o __libcheck.i __libcheck.c | ||
cc -S -Wall -Werror -pedantic -Wextra -std=gnu99 __libcheck.i -o __libcheck.s -Wno-unused-label -Wno-uninitialized | ||
|
||
ec="$?" | ||
rm __libcheck.s __libcheck.i __libcheck.c | ||
[ "${ec}" -eq 0 ] || exit "${ec}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.