Skip to content

Commit 0a668ae

Browse files
committed
Merge commit '6f386e5eeffa223e7213b596403085f8b497023e' into pull-support-20170908-2
2 parents 04b4f63 + 5a58539 commit 0a668ae

File tree

1,431 files changed

+31224
-7209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,431 files changed

+31224
-7209
lines changed
File renamed without changes.

.travis.yml

Lines changed: 57 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,61 @@
11
language: cpp
22

3-
matrix:
3+
jobs:
44
include:
55

6+
- &linter-stage
7+
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
8+
env: NAME="CPP-LINT"
9+
install:
10+
script: scripts/travis_lint.sh
11+
before_cache:
12+
13+
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
14+
env: NAME="DOXYGEN-CHECK"
15+
addons:
16+
apt:
17+
packages:
18+
- doxygen
19+
install:
20+
script: scripts/travis_doxygen.sh
21+
before_cache:
22+
23+
# Ubuntu Linux with glibc using g++-5
24+
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
25+
os: linux
26+
sudo: false
27+
compiler: gcc
28+
cache: ccache
29+
addons:
30+
apt:
31+
sources:
32+
- ubuntu-toolchain-r-test
33+
packages:
34+
- libwww-perl
35+
- g++-5
36+
- libubsan0
37+
before_install:
38+
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
39+
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
40+
env: COMPILER="ccache g++-5"
41+
642
# Alpine Linux with musl-libc using g++
7-
- os: linux
43+
- stage: Test different OS/CXX/Flags
44+
os: linux
845
sudo: required
946
compiler: gcc
1047
cache: ccache
1148
services:
1249
- docker
1350
before_install:
14-
- docker pull diffblue/cbmc-builder:alpine-0.0.1
51+
- docker pull diffblue/cbmc-builder:alpine-0.0.3
1552
env:
16-
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc -v ${HOME}/.ccache:/root/.ccache diffblue/cbmc-builder:alpine-0.0.1"
53+
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc -v ${HOME}/.ccache:/root/.ccache diffblue/cbmc-builder:alpine-0.0.3"
1754
- COMPILER="ccache g++"
1855

1956
# OS X using g++
20-
- os: osx
57+
- stage: Test different OS/CXX/Flags
58+
os: osx
2159
sudo: false
2260
compiler: gcc
2361
cache: ccache
@@ -26,42 +64,24 @@ matrix:
2664
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
2765
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
2866
- export PATH=/usr/local/opt/ccache/libexec:$PATH
29-
- ccache -M 1G
30-
env: COMPILER=g++
67+
env: COMPILER="ccache g++"
3168

3269
# OS X using clang++
33-
- os: osx
70+
- stage: Test different OS/CXX/Flags
71+
os: osx
3472
sudo: false
3573
compiler: clang
3674
cache: ccache
3775
before_install:
3876
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
3977
- export PATH=/usr/local/opt/ccache/libexec:$PATH
40-
- ccache -M 1G
4178
env:
4279
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
4380
- CCACHE_CPP2=yes
4481

45-
# Ubuntu Linux with glibc using g++-5
46-
- os: linux
47-
sudo: false
48-
compiler: gcc
49-
cache: ccache
50-
addons:
51-
apt:
52-
sources:
53-
- ubuntu-toolchain-r-test
54-
packages:
55-
- libwww-perl
56-
- g++-5
57-
- libubsan0
58-
before_install:
59-
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
60-
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
61-
env: COMPILER="g++-5"
62-
6382
# Ubuntu Linux with glibc using g++-5, debug mode
64-
- os: linux
83+
- stage: Test different OS/CXX/Flags
84+
os: linux
6585
sudo: false
6686
compiler: gcc
6787
cache: ccache
@@ -77,12 +97,13 @@ matrix:
7797
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
7898
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
7999
env:
80-
- COMPILER="g++-5"
100+
- COMPILER="ccache g++-5"
81101
- EXTRA_CXXFLAGS="-DDEBUG"
82102
script: echo "Not running any tests for a debug build."
83103

84104
# Ubuntu Linux with glibc using clang++-3.7
85-
- os: linux
105+
- stage: Test different OS/CXX/Flags
106+
os: linux
86107
sudo: false
87108
compiler: clang
88109
cache: ccache
@@ -105,7 +126,8 @@ matrix:
105126
- CCACHE_CPP2=yes
106127

107128
# Ubuntu Linux with glibc using clang++-3.7, debug mode
108-
- os: linux
129+
- stage: Test different OS/CXX/Flags
130+
os: linux
109131
sudo: false
110132
compiler: clang
111133
cache: ccache
@@ -129,31 +151,17 @@ matrix:
129151
- EXTRA_CXXFLAGS="-DDEBUG"
130152
script: echo "Not running any tests for a debug build."
131153

132-
- env: NAME="CPP-LINT"
133-
install:
134-
script: scripts/travis_lint.sh
135-
before_cache:
136-
137-
- env: NAME="DOXYGEN-CHECK"
138-
addons:
139-
apt:
140-
packages:
141-
- doxygen
142-
install:
143-
script: scripts/travis_doxygen.sh
144-
before_cache:
145-
146154
allow_failures:
147-
- env: NAME="CPP-LINT"
148-
install:
149-
script: scripts/travis_lint.sh
150-
before_cache:
155+
- <<: *linter-stage
151156

152157
install:
158+
- ccache --max-size=1G
153159
- COMMAND="make -C src minisat2-download" &&
154160
eval ${PRE_COMMAND} ${COMMAND}
155161
- COMMAND="make -C src boost-download" &&
156162
eval ${PRE_COMMAND} ${COMMAND}
163+
- COMMAND="make -C src/ansi-c library_check" &&
164+
eval ${PRE_COMMAND} ${COMMAND}
157165
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -Werror -pedantic -O2 -g -DUSE_BOOST $EXTRA_CXXFLAGS\" -j2" &&
158166
eval ${PRE_COMMAND} ${COMMAND}
159167
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"$FLAGS $EXTRA_CXXFLAGS\" -j2 clobber.dir memory-models.dir musketeer.dir" &&

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* GOTO-INSTRUMENT: New option --remove-function-body
1111
* GOTO-INSTRUMENT: New option --use-all-headers, changed --use-system-headers to
1212
--no-system-headers
13+
* GOTO-INSTRUMENT: dump-c can output the generated environment via --harness
1314

1415

1516
5.7

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,31 @@ and passing the resulting equation to a decision procedure.
1515

1616
For full information see [cprover.org](http://www.cprover.org/cbmc).
1717

18+
Versions
19+
========
20+
21+
Get the [latest release](https://github.com/diffblue/cbmc/releases)
22+
* Releases are tested and for production use.
23+
24+
Get the current *develop* version: `git clone https://github.com/diffblue/cbmc.git`
25+
* Develop versions are not recommended for production use.
26+
27+
Report bugs
28+
===========
29+
30+
If you encounter a problem please file a bug report:
31+
* Create an [issue](https://github.com/diffblue/cbmc/issues)
32+
33+
Contributing to the code base
34+
=============================
35+
36+
1. Fork the repository
37+
2. Clone the repository `git clone [email protected]:YOURNAME/cbmc.git`
38+
3. Create a branch from the `develop` branch (default branch)
39+
4. Make your changes (follow the [coding guidelines](https://github.com/diffblue/cbmc/blob/develop/CODING_STANDARD.md))
40+
5. Push your changes to your branch
41+
6. Create a Pull Request targeting the `develop` branch
42+
1843
License
1944
=======
2045
4-clause BSD license, see `LICENSE` file.

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ test_script:
109109
rmdir /s /q cbmc-java\classpath1
110110
rmdir /s /q cbmc-java\jar-file3
111111
rmdir /s /q cbmc-java\tableswitch2
112+
rmdir /s /q goto-gcc
112113
rmdir /s /q goto-instrument\slice08
113114
114115
make test

regression/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests.log

regression/Makefile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
DIRS = ansi-c \
22
cbmc \
3-
cpp \
3+
cbmc-cover \
44
cbmc-java \
5+
cbmc-java-inheritance \
6+
cpp \
57
goto-analyzer \
8+
goto-diff \
9+
goto-gcc \
610
goto-instrument \
711
goto-instrument-typedef \
8-
goto-diff \
912
invariants \
13+
strings \
14+
strings-smoke-tests \
1015
test-script \
1116
# Empty last line
1217

13-
18+
# Check for the existence of $dir. Tests under goto-gcc cannot be run on
19+
# Windows, so appveyor.yml unlinks the entire directory under Windows.
1420
test:
15-
$(foreach var,$(DIRS), $(MAKE) -C $(var) test || exit 1;)
21+
@for dir in $(DIRS); do \
22+
if [ -d "$$dir" ]; then \
23+
$(MAKE) -C "$$dir" test || exit 1; \
24+
fi; \
25+
done;
1626

1727
clean:
1828
@for dir in *; do \

regression/ansi-c/Union_Padding1/main.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,33 @@ STATIC_ASSERT(sizeof(union some_union4)==3);
6262

6363
#endif
6464

65+
#ifdef _MSC_VER
66+
67+
union some_union5
68+
{
69+
int i;
70+
};
71+
72+
STATIC_ASSERT(__alignof(union some_union5)==1);
73+
74+
#else
75+
76+
union some_union5
77+
{
78+
int i;
79+
};
80+
81+
union some_union6
82+
{
83+
int i;
84+
} __attribute__((__packed__));
85+
86+
// Packing may affect alignment
87+
STATIC_ASSERT(_Alignof(union some_union5)==4);
88+
STATIC_ASSERT(_Alignof(union some_union6)==1);
89+
90+
#endif
91+
6592
int main()
6693
{
6794
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
static unsigned bar()
2+
{
3+
unsigned r;
4+
return r;
5+
}
6+
7+
#ifdef _MSC_VER
8+
9+
static void foo()
10+
{
11+
}
12+
13+
#else
14+
15+
static void foo()
16+
{
17+
unsigned len=bar();
18+
struct {
19+
int a;
20+
union {
21+
int s;
22+
unsigned char b[len];
23+
} __attribute__ (( packed )) S;
24+
int c;
25+
} __attribute__ (( packed )) *l;
26+
}
27+
28+
#endif
29+
30+
int main()
31+
{
32+
foo();
33+
return 0;
34+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extern char src_start[];
2+
extern char src_end[];
3+
extern char dst_start[];
4+
5+
void *memcpy(void *dest, void *src, unsigned n){
6+
return (void *)0;
7+
}
8+
9+
int main(){
10+
memcpy(dst_start, src_start, (unsigned)src_end - (unsigned)src_start);
11+
return 0;
12+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MEMORY {
2+
RAM : ORIGIN = 0x0, LENGTH = 25M
3+
}
4+
5+
SECTIONS
6+
{
7+
/* GCC insists on having these */
8+
.note.gnu.build-id : { } > RAM
9+
.text : { } > RAM
10+
11+
.src_section : {
12+
src_start = .;
13+
*(.text*)
14+
src_end = .;
15+
} > RAM
16+
17+
.dst_section : {
18+
dst_start = .;
19+
*(.text*)
20+
dst_end = .;
21+
} > RAM
22+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CORE
2+
main.c
3+
-o out.gb -T script.ld -nostdlib
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
9+
--
10+
Tesing the functionality of goto-cc's linker script parsing
11+
functionality, ensuring that it can get the values of symbols that are
12+
defined in linker scripts.
13+
14+
This test ensures that goto-cc and ls-parse can:
15+
16+
- get the value of a symbol whose value indicates the start of a section;
17+
- get the value of a symbol whose value indicates the end of a section.

0 commit comments

Comments
 (0)