Skip to content

Update test-gen-support from master #941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 137 commits into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
c393197
Regression tests for not instrumenting built-ins
peterschrammel Oct 27, 2016
12d6582
Ignore built-in functions and instructions inlined from built-ins dur…
peterschrammel Nov 3, 2016
bfeea76
Add documentation to irep_ids
reuk Apr 19, 2017
dbb9cfd
add visibility information for fields and methods
Apr 19, 2017
286fcc5
Lazy loading: load static initializers for needed classes. Fixes #846
smowton Apr 21, 2017
3ee1918
Improve style in goto_program_template.h
reuk Apr 21, 2017
cd72883
Fixed inefficiency and failure to pass on parameter
NathanJPhillips Apr 24, 2017
d85487c
Fix formatting in cegis-util/type_helper.cpp
reuk Apr 25, 2017
549e589
Remove an unused conversion function that is broken anyway, and tidy …
forejtv Apr 25, 2017
49b77ce
Change utf8 to utf16 conversion to not require codecvt.
forejtv Apr 25, 2017
735c152
Add CBMC package build file for Arch Linux
Apr 26, 2017
1dc27ae
Build cleanly without globally disabling warnings
reuk Apr 26, 2017
130287f
Remove unnecessary flags from travis.yml
reuk Apr 26, 2017
16ff24b
Remove unnecessary asserts
reuk Apr 26, 2017
24fd67b
Give pragma files a '.def' suffix
reuk Apr 26, 2017
b0196c5
Merge pull request #875 from zemanlx/feature/arch-package
Apr 27, 2017
065810f
Merge pull request #868 from forejtv/feature/unicode-cleanup
Apr 27, 2017
05a4ef6
Merge pull request #867 from reuk/linter-complaint-master
Apr 27, 2017
10015b1
Merge pull request #855 from smowton/fix/lazy_methods_and_clinit
Apr 27, 2017
9e42f4f
Merge pull request #847 from mgudemann/feature/java_visibility
Apr 27, 2017
923c43d
Merge pull request #842 from reuk/irep-ids-doc
Apr 28, 2017
3c98129
Fix return of temporary ref in ssa_exprt
reuk Apr 28, 2017
606bba4
comment on division by zero
May 2, 2017
dab1510
Adapted DLFCN variable in CEGIS Makefile
pkesseli May 2, 2017
832eb93
Merge pull request #881 from reuk/ref-to-tmp-fix
May 3, 2017
cf1b4b4
Merge pull request #859 from reuk/goto-prog-style
May 3, 2017
443225c
Clean up code
May 4, 2017
024214b
cegis now lives in a separate repo
May 4, 2017
e7fb0fb
cegis now lives in separate repo ; removed the cegis tests
May 4, 2017
1da7775
Merge pull request #888 from owen-jones-diffblue/cleanup/using-expr2c…
May 4, 2017
cdf7180
removed cegis.dir build from Travis
May 4, 2017
f185cfd
Merge pull request #862 from NathanJPhillips/bugfix/inlining-errors
May 4, 2017
163dfb3
fix division by zero comment
May 5, 2017
68e1595
Deleted copy/added move constructor.
pkesseli May 7, 2017
f107f21
Added explicit move constructor to temporary_filet
pkesseli May 7, 2017
f34b705
Moved vector_hasht implementation into cpp file
NathanJPhillips May 8, 2017
839394d
Merge pull request #893 from pkesseli/tempfile-copy-move
May 8, 2017
448853c
Merge pull request #873 from reuk/pedantic-fix
May 9, 2017
4bc2e72
Avoid unlink call on empty string
pkesseli May 9, 2017
7e63380
Fixed warning in unicode.cpp causing build failure
NathanJPhillips May 9, 2017
10eb073
Enabled warnings as errors in config.inc to match travis settings
NathanJPhillips May 9, 2017
eac93e3
Merge pull request #897 from NathanJPhillips/bugfix/warning-in-unicode
May 9, 2017
ea526d0
Fixed format according to linter message.
pkesseli May 9, 2017
3391d45
Basic harness for unit tests
Apr 25, 2017
de73265
Add unit tests to the CI files
Apr 26, 2017
b22210d
Updated coding standard to explain unit testing
Apr 26, 2017
760e1fc
Renamed exe and added exes to gitignore
Apr 28, 2017
915b488
Merge pull request #895 from NathanJPhillips/cleanup/break-irep-hash-…
May 10, 2017
3f1afed
added multi_ary_exprt
May 11, 2017
35eb739
use multi_ary_exprt
May 11, 2017
aca7419
do __builtin_convertvector
May 11, 2017
969eaa6
Replaced get_goto_modelt with initialize_goto_model
NathanJPhillips May 11, 2017
cfad717
Renamed initialize_goto_model files
NathanJPhillips May 10, 2017
0f08b58
__CPROVER_isinf heading
May 12, 2017
b321b4a
a paragraph on __CPROVER_cover
May 12, 2017
bab30f9
Merge pull request #292 from peterschrammel/do-not-instrument-built-ins
May 12, 2017
8c4d8c5
Enable goto_modelt move assignment
NathanJPhillips May 10, 2017
389fbcd
Removed copy constructor from goto_function_templatet
NathanJPhillips May 10, 2017
9755f6f
formatting
May 12, 2017
b1e9fc0
Coverage Criteria
May 12, 2017
23e2eae
beautify coverage table
May 12, 2017
064f648
beautify coverage table
May 12, 2017
b0b0e23
Use strong enum in custom_bitvector_analysis
reuk May 14, 2017
8069c83
Use strong enum in dependence_graph
reuk May 14, 2017
6d888c2
Use strong enum in goto_rw
reuk May 14, 2017
617a6fb
Use new enum syntax in local_bitvector_analysis
reuk May 14, 2017
e2c436a
Use strong enum in ansi_c_parser
reuk May 14, 2017
351e3a7
Rename convert to convert_with_precedence
May 15, 2017
166c2bd
Use strong enum in ansi_c_scope
reuk May 14, 2017
b40a351
Use strong enum in cpp_id.h
reuk May 14, 2017
66135c9
Use strong enum in cpp_typecheck_resolve
reuk May 14, 2017
3d68275
Use strong enum in cpp/parse
reuk May 14, 2017
f2b3d5f
Use strong enum in change_impact
reuk May 14, 2017
5c474b4
Use strong enum in object_id
reuk May 14, 2017
eed1b59
Use strong enum in unwind
reuk May 14, 2017
5b59675
Use strong enum in abstract_event
reuk May 14, 2017
fe145a2
Use new enum syntax in wmm
reuk May 14, 2017
fff0dbf
Use new enum syntax in elf_reader
reuk May 14, 2017
1355db6
Use strong enum in format_strings
reuk May 14, 2017
6dfa028
Use strong enum in goto_trace
reuk May 14, 2017
5e24f7c
Use strong enum in property_checker
reuk May 14, 2017
c090958
Use strong enum in safety_checker
reuk May 14, 2017
5fb4ca0
Use string enum in string_abstraction
reuk May 14, 2017
7413755
Use strong enum in wp
reuk May 14, 2017
b99dcdc
Use strong enum in find_symbols
reuk May 14, 2017
3f3d6ea
Use new enum syntax in goto_symex_state
reuk May 14, 2017
803b5d9
Use new enum syntax in partial_order_concurrency
reuk May 14, 2017
a65b8ff
Use strong enum in symex_target
reuk May 14, 2017
155cb67
Use new enum syntax in java_bytecode-convert_method_class
reuk May 14, 2017
49a7a02
Use new enum syntax in fence_inserter
reuk May 14, 2017
a990c2c
Use new enum syntax in infer_mode
reuk May 14, 2017
60de3da
Use strong enum in value_set_dereference
reuk May 14, 2017
c3c6706
Use strong enum in ui_message
reuk May 14, 2017
84a8106
Use strong enum in json
reuk May 14, 2017
4b6edc0
Use new enum syntax in ieee_float
reuk May 14, 2017
79eab3f
Use strong enum in format_spec
reuk May 14, 2017
5526b1a
Use strong enum in decision_procedure
reuk May 14, 2017
0ceedff
Use strong enum in smt1_conv
reuk May 14, 2017
c688bad
Use strong enums in smt2_conv
reuk May 14, 2017
f614e54
Use strong enum in cnf
reuk May 14, 2017
d9ba0e4
Use strong enum in qbf_cnf
reuk May 14, 2017
d0e7285
Use strong enum in prop_conv_store
reuk May 14, 2017
b950563
Use strong enum in prop
reuk May 14, 2017
2f989d1
Use strong enum in arrays
reuk May 14, 2017
7e2ba33
Use strong enum in boolbv
reuk May 14, 2017
1c65fe4
Use strong enum in boolbv_map
reuk May 14, 2017
5a46f0e
Use strong enum in bv_utils
reuk May 14, 2017
d0f9e43
Use strong enum in float_bv
reuk May 14, 2017
6135bdb
Use strong enum in float_utils
reuk May 14, 2017
d573bf2
Use new enum syntax in qdimacs_core
reuk May 14, 2017
5027947
Use new enum syntax in satcheck_zchaff
reuk May 14, 2017
947a75c
Merge pull request #916 from owen-jones-diffblue/cleanup/using-expr2c…
May 15, 2017
7e1ba16
Merge pull request #874 from thk123/feature/unit-test-framework
May 15, 2017
fc4c0fe
Merge pull request #880 from NathanJPhillips/feature/enable-goto-mode…
May 15, 2017
bd37426
Merge pull request #904 from NathanJPhillips/cleanup/initialise-goto-…
May 15, 2017
ad41375
Allow anonymous namespaces
May 16, 2017
aa0b340
Fix missing += in Makefile that causes issues in building unit test
NathanJPhillips May 16, 2017
d29a873
Merge pull request #929 from owen-jones-diffblue/doc/coding-standard-…
May 16, 2017
d4e8149
Merge pull request #920 from reuk/strongly-typed-enums
May 16, 2017
b8c59de
Merge pull request #899 from pkesseli/tempfile-avoid-unnecessary-unlink
May 16, 2017
2f0ba52
Merge pull request #928 from NathanJPhillips/bugfix/unit-Makefile-ove…
May 16, 2017
c34be32
Fix java argument input declarations
Apr 13, 2017
41bc492
printf formatter supports %e and %E
May 12, 2017
8e532ee
get closer to what implementations do with %g
May 12, 2017
31cba6b
Updated Travis to catch warnings in unit tests
NathanJPhillips May 16, 2017
f092445
Add brackets to resolve ambiguity caused by use of bitwise instead of…
NathanJPhillips May 16, 2017
2d31501
test for printf
May 16, 2017
dffb4ef
Merge pull request #914 from diffblue/pretty-float
tautschnig May 16, 2017
bd4221c
Merge pull request #927 from NathanJPhillips/bugfix/mini_bdd-operators
May 17, 2017
b88f98f
Remove unneeded code
May 18, 2017
0ff98e8
Merge pull request #823 from owen-jones-diffblue/bugfix/java-paramete…
May 18, 2017
f038ac1
Merge pull request #937 from owen-jones-diffblue/cleanup/using-expr2c…
May 18, 2017
cbbbef6
Refactor java argument creation code
Apr 25, 2017
405ce62
Factor Java object factory
smowton Apr 25, 2017
c4412e9
Merge pull request #871 from smowton/refactor-java-object-factory
peterschrammel May 19, 2017
f9748b1
Merge commit 'c4412e9' into merge-master-20170522
smowton May 22, 2017
8510374
Revert "Remove variable that is always false"
May 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ install:
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -Werror -pedantic -O2 -g $EXTRA_CXXFLAGS\" -j2" &&
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"$FLAGS $EXTRA_CXXFLAGS\" -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"$FLAGS $EXTRA_CXXFLAGS\" -j2 clobber.dir memory-models.dir musketeer.dir" &&
eval ${PRE_COMMAND} ${COMMAND}

script:
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
COMMAND="env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test" &&
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C unit CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -Werror -pedantic -O2 -g $EXTRA_CXXFLAGS\" -j2" &&
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C unit test" && eval ${PRE_COMMAND} ${COMMAND}

before_cache:
- ccache -s
48 changes: 33 additions & 15 deletions CODING_STANDARD
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ Whitespaces:
- No whitespaces in blank lines
- Put argument lists on next line (and ident 2 spaces) if too long
- Put parameters on separate lines (and ident 2 spaces) if too long
- No whitespaces around colon for inheritance,
- No whitespaces around colon for inheritance,
put inherited into separate lines in case of multiple inheritance
- The initializer list follows the constructor without a whitespace
around the colon. Break line after the colon if required and indent members.
- if(...), else, for(...), do, and while(...) are always in a separate line
- Break expressions in if, for, while if necessary and align them
- Break expressions in if, for, while if necessary and align them
with the first character following the opening parenthesis
- Use {} instead of ; for the empty statement
- Single line blocks without { } are allowed,
- Single line blocks without { } are allowed,
but put braces around multi-line blocks
- Use blank lines to visually separate logically cohesive code blocks
- Use blank lines to visually separate logically cohesive code blocks
within a function
- Have a newline at the end of a file

Comments:
- Do not use /* */ except for file and function comment blocks
- Each source and header file must start with a comment block
- Each source and header file must start with a comment block
stating the Module name and Author [will be changed when we roll out doxygen]
- Each function in the source file (not the header) is preceded
by a function comment header consisting of a comment block stating
Expand Down Expand Up @@ -75,9 +75,9 @@ Comments:
- Use #ifdef DEBUG to guard debug code

Naming:
- Identifiers may use the characters [a-z0-9_] and should start with a
- Identifiers may use the characters [a-z0-9_] and should start with a
lower-case letter (parameters in constructors may start with _).
- Use american spelling for identifiers.
- Use american spelling for identifiers.
- Separate basic words by _
- Avoid abbreviations (e.g. prefer symbol_table to of st).
- User defined type identifiers have to be terminated by 't'. Moreover,
Expand Down Expand Up @@ -122,7 +122,7 @@ Program Command Line Options
from the command line into the options

C++ features:
- Do not use namespaces.
- Do not use namespaces, except for anonymous namespaces.
- Prefer use of 'typedef' insted of 'using'.
- Prefer use of 'class' instead of 'struct'.
- Write type modifiers before the type specifier.
Expand All @@ -136,7 +136,7 @@ C++ features:
- Avoid iterators, use ranged for instead
- Avoid allocation with new/delete, use unique_ptr
- Avoid pointers, use references
- Avoid char *, use std::string
- Avoid char *, use std::string
- For numbers, use int, unsigned, long, unsigned long, double
- Use mp_integer, not BigInt
- Use the functions in util for conversions between numbers and strings
Expand All @@ -146,13 +146,13 @@ C++ features:
- Use instances of std::size_t for comparison with return values of .size() of
STL containers and algorithms, and use them as indices to arrays or vectors.
- Do not use default values in public functions
- Use assertions to detect programming errors, e.g. whenever you make
- Use assertions to detect programming errors, e.g. whenever you make
assumptions on how your code is used
- Use exceptions only when the execution of the program has to abort
- Use exceptions only when the execution of the program has to abort
because of erroneous user input
- We allow to use 3rd-party libraries directly.
No wrapper matching the coding rules is required.
Allowed libraries are: STL.
- We allow to use 3rd-party libraries directly.
No wrapper matching the coding rules is required.
Allowed libraries are: STL.
- When throwing, omit the brackets, i.e. `throw "error"`.
- Error messages should start with a lower case letter.
- Use the auto keyword if and only if one of the following
Expand All @@ -165,12 +165,30 @@ Architecture-specific code:
- Don't include architecture-specific header files without #ifdef ...

Output:
- Do not output to cout or cerr directly (except in temporary debug code,
- Do not output to cout or cerr directly (except in temporary debug code,
and then guard #include <iostream> by #ifdef DEBUG)
- Derive from messaget if the class produces output and use the streams provided
(status(), error(), debug(), etc)
- Use '\n' instead of std::endl

Unit tests:
- Unit tests are written using Catch: https://github.com/philsquared/Catch/
- For large classes:
- Create a separate file that contains the tests for each method of each
class
- The file should be named according to
`unit/class/path/class_name/function_name.cpp`
- For small classes:
- Create a separate file that contains the tests for all methods of each
class
- The file should be named according to unit/class/path/class_name.cpp
- Catch supports tagging, tests should be tagged with all the following tags:
- [core] should be used for all tests unless the test takes more than 1
second to run, then it should be tagged with [long]
- [folder_name] of the file being tested
- [class_name] of the class being tested
- [function_name] of the function being tested

You are allowed to break rules if you have a good reason to do so.

Pre-commit hook to run cpplint locally
Expand Down
2 changes: 1 addition & 1 deletion COMPILING
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.

yum install gcc gcc-c++ flex bison perl-libwww-perl patch devtoolset-6

Note that you need g++ version 5.2 or newer.
Note that you need g++ version 4.9 or newer.

1) As a user, get the CBMC source via

Expand Down
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ build_script:
cp -r deps/minisat2-2.2.1 minisat-2.2.1
patch -d minisat-2.2.1 -p1 < scripts/minisat-2.2.1-patch
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
sed -i "s/BUILD_ENV.*/BUILD_ENV = MSVC/" src/config.inc
sed -i "s/BUILD_ENV[ ]*=.*/BUILD_ENV = MSVC/" src/config.inc
make -C src -j2

test_script:
Expand Down Expand Up @@ -108,3 +108,7 @@ test_script:
rmdir /s /q goto-instrument\slice08

make test

cd ..
make -C unit all
make -C unit test
7 changes: 5 additions & 2 deletions doc/html-manual/api.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ void __CPROVER_cover(_Bool condition);
</code>
<hr>

<p>This statement defines a custom coverage criterion, for usage
with the <a href="cover.shtml">test suite generation feature</a>.</p>

<p class="justified">
</p>

<h4>__CPROVER_isnan, __CPROVER_isfinite, __CPROVER_isfinite,
__CPROVER_isfinite, __CPROVER_sign</h4>
<h4>__CPROVER_isnan, __CPROVER_isfinite, __CPROVER_isinf,
__CPROVER_isnormal, __CPROVER_sign</h4>

<hr>
<code>
Expand Down
40 changes: 38 additions & 2 deletions doc/html-manual/cover.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

<h3>A Small Tutorial with A Case Study</h3>

<!--<h4>Verilog vs. ANSI-C</h4>-->

<p class="justified">
We assume that CBMC is installed on your system. If not so, follow
<a href="installation-cbmc.shtml">these instructions</a>.</p>
Expand Down Expand Up @@ -238,4 +236,42 @@ coverage criteria like <code>branch</code>, <code>decision</code>,
<code>path</code> etc. are also available when calling CBMC.
</p>

<h3>Coverage Criteria</h3>

<p class="justified">
The table below summarizes the coverage criteria that CBMC supports.
</p>

<table class="fancy">

<tr><th>Criterion</th><th>Definition</th></tr>

<tr><td>assertion</td>
<td>For every assertion, generate a test that reaches it</td></tr>

<tr><td class="alt">location</td>
<td class="alt">For every location, generate a test that reaches it</td></tr>

<tr><td>branch</td>
<td>Generate a test for every branch outcome</td></tr>

<tr><td class="alt">decision</td>
<td class="alt">Generate a test for both outcomes of every Boolean expression
that is not an operand of a propositional connective</td></tr>

<tr><td>condition</td>
<td>Generate a test for both outcomes of every Boolean expression</td></tr>

<tr><td class="alt">mcdc</td>
<td class="alt">Modified Condition/Decision Coverage (MC/DC)</td></tr>

<tr><td>path</td>
<td>Bounded path coverage</td></tr>

<tr><td class="alt">cover</td>
<td class="alt">Generate a test for every <code>__CPROVER_cover</code> statement
</td></tr>

</table>

<!--#include virtual="footer.inc" -->
5 changes: 2 additions & 3 deletions doc/html-manual/modeling-nondet.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ prefix <code>nondet_</code>. As an example, the following function
returns a nondeterministically chosen unsigned short int:
</p>

<code>
unsigned short int nondet_ushortint();
</code>
<pre><code class="c">unsigned short int nondet_ushortint();
</code></pre>

<p class="justified">Note that the body of the function is not defined. The
name of the function itself is irrelevant (save for the prefix), but must be
Expand Down
40 changes: 40 additions & 0 deletions pkg/arch/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Maintainer: Vlastimil Zeman <[email protected]>

pkgname=cbmc
pkgver=5.7
pkgrel=1
pkgdesc="Bounded Model Checker for C and C++ programs"
arch=("x86_64")
url="https://github.com/diffblue/cbmc"
license=("BSD-4-Clause")
depends=("gcc-libs>=6.3")
makedepends=("gcc>=6.3"
"make>=4.2"
"patch>=2.7"
"perl-libwww>=6.24"
"bison>=3.0"
"flex>=2.6")
source=("https://github.com/diffblue/cbmc/archive/$pkgname-$pkgver.tar.gz")
sha256sums=("4f98cdce609532d3fc2587299ee4a6544f63aff5cf42e89d2baaa3d3562edf3e")


build() {
make -C "$pkgname-$pkgname-$pkgver/src" minisat2-download
make -C "$pkgname-$pkgname-$pkgver/src" -j$(getconf _NPROCESSORS_ONLN)
}


check() {
make -C "$pkgname-$pkgname-$pkgver/regression" test
}


package() {
mkdir -p "$pkgdir/usr/bin/"
for binary in $pkgname goto-analyzer goto-cc goto-diff goto-instrument
do
cp "$pkgname-$pkgname-$pkgver/src/$binary/$binary" "$pkgdir/usr/bin/"
chmod 755 "$pkgdir/usr/bin/$binary"
chown root:root "$pkgdir/usr/bin/$binary"
done
}
17 changes: 17 additions & 0 deletions pkg/arch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Arch Linux Package

Update packages and install build dependencies

```bash
sudo pacman -Sy archlinux-keyring && sudo pacman -Syyu
sudo pacman -S gcc bison flex make patch perl-libwww fakeroot
```

Create folder for package and copy [PKGBUILD](PKGBUILD) file there.

Build package by running `makepkg` in that folder. That will compile *CBMC* and
run all tests. To install package run

```bash
sudo pacman -U cbmc-5.7-1-x86_64.pkg.tar.xz`
```
17 changes: 17 additions & 0 deletions regression/cbmc-cover/built-ins1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
int main()
{
char a[10];
__CPROVER_input("a[3]", a[3]);

int len = strlen(a);

if(len==3)
{
return 0;
}
else if(len==4)
{
return -1;
}
return 1;
}
9 changes: 9 additions & 0 deletions regression/cbmc-cover/built-ins1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
main.c
--cover location --unwind 1
^EXIT=0$
^SIGNAL=0$
^\*\* 4 of 7 covered
--
^warning: ignoring
^\[.*<builtin-library-
19 changes: 19 additions & 0 deletions regression/cbmc-cover/built-ins2/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
struct mystruct {
int x;
char y;
};

int main()
{
struct mystruct s;
char c;
__CPROVER_input("c", c);

memset(&s,c,sizeof(struct mystruct));

if(s.y=='A')
{
return 0;
}
return 1;
}
9 changes: 9 additions & 0 deletions regression/cbmc-cover/built-ins2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
main.c
--cover location --unwind 10
^EXIT=0$
^SIGNAL=0$
^\*\* 4 of 4 covered
--
^warning: ignoring
^\[.*<builtin-library-
14 changes: 14 additions & 0 deletions regression/cbmc-cover/built-ins3/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>

int main()
{
const char *s="test";
int ret=puts(s); //return value is nondet (internal to built-in, thus non-controllable)

if(ret<0)
{
return 1;
}

return 0;
}
9 changes: 9 additions & 0 deletions regression/cbmc-cover/built-ins3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
main.c
--cover location --unwind 10
^EXIT=0$
^SIGNAL=0$
^\*\* 4 of 4 covered
--
^warning: ignoring
^\[.*<builtin-library-
17 changes: 17 additions & 0 deletions regression/cbmc-cover/built-ins4/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
int main()
{
char a[10];
__CPROVER_input("a[3]", a[3]);

int len = strlen(a);

if(len==3)
{
return 0;
}
else if(len==4)
{
return -1;
}
return 1;
}
Loading