Skip to content

Commit 5e067bf

Browse files
authored
Merge pull request diffblue#1481 from andreast271/do-c++-regression
Run cbmc c++ regression as part of default regression test
2 parents c9b6c42 + b0742cf commit 5e067bf

File tree

12 files changed

+65
-1
lines changed

12 files changed

+65
-1
lines changed

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ test_script:
8383
rmdir /s /q cbmc\byte_update7
8484
rmdir /s /q cbmc\pipe1
8585
rmdir /s /q cbmc\unsigned___int128
86+
rmdir /s /q cbmc-cpp
8687
rmdir /s /q cpp\Decltype1
8788
rmdir /s /q cpp\Decltype2
8889
rmdir /s /q cpp\Function_Overloading1

regression/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ endmacro(add_test_pl_tests)
2525

2626
add_subdirectory(ansi-c)
2727
add_subdirectory(cbmc)
28+
add_subdirectory(cbmc-cover)
29+
add_subdirectory(cbmc-cpp)
2830
add_subdirectory(cbmc-java)
2931
add_subdirectory(cbmc-java-inheritance)
3032
add_subdirectory(cpp)
3133
add_subdirectory(goto-analyzer)
34+
add_subdirectory(goto-analyzer-taint)
3235
add_subdirectory(goto-cc-cbmc)
3336
add_subdirectory(goto-cc-goto-analyzer)
3437
add_subdirectory(goto-diff)

regression/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DIRS = ansi-c \
22
cbmc \
33
cbmc-cover \
4+
cbmc-cpp \
45
cbmc-java \
56
cbmc-java-inheritance \
67
cpp \

regression/cbmc-cover/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"$<TARGET_FILE:cbmc>"
3+
)

regression/cbmc-cpp/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"$<TARGET_FILE:cbmc>"
3+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <assert.h>
2+
int x;
3+
4+
void g(int i){
5+
x=i;
6+
}
7+
8+
int main() {
9+
g(3);
10+
assert(x==3);
11+
}
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <assert.h>
2+
unsigned x;
3+
4+
class ct {
5+
void f(int i) {
6+
x=x+i;
7+
}
8+
};
9+
10+
int main() {
11+
unsigned r;
12+
x=r%3;
13+
ct c;
14+
c.f(2);
15+
assert(x<4);
16+
assert(x<5);
17+
}
18+
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.cpp
3+
4+
instance is SATISFIABLE$
5+
instance is UNSATISFIABLE$
6+
^EXIT=10$
7+
^SIGNAL=0$
8+
^VERIFICATION FAILED$
9+
--
10+
^warning: ignoring

regression/cbmc-cpp/union2/main.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <assert.h>
12
struct A
23
{
34
union
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"$<TARGET_FILE:goto-analyzer>"
3+
)

src/cpp/cpp_typecheck_function.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ void cpp_typecheckt::convert_parameter(
4444
symbol.type=parameter.type();
4545
symbol.is_state_var=true;
4646
symbol.is_lvalue=!is_reference(symbol.type);
47+
symbol.is_parameter=true;
4748

48-
assert(!symbol.base_name.empty());
49+
INVARIANT(!symbol.base_name.empty(), "parameter has base name");
4950

5051
symbolt *new_symbol;
5152

0 commit comments

Comments
 (0)