Skip to content

Commit

Permalink
Merge pull request #7809 from NlightNFotis/address_of_field
Browse files Browse the repository at this point in the history
Enable all struct tests under `regression/cbmc/` for new SMT backend
  • Loading branch information
thomasspriggs authored Oct 10, 2023
2 parents 0838c70 + eadb111 commit cf380d5
Show file tree
Hide file tree
Showing 39 changed files with 98 additions and 35 deletions.
2 changes: 1 addition & 1 deletion regression/cbmc/Anonymous_Struct1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
--pointer-check
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Anonymous_Struct2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Anonymous_Struct3/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
-win32
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Array1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Bytewise1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
struct_bytewise.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Bytewise2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization10/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization3/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization4/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization6/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization7/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization8/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FUTURE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Initialization9/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Padding1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.i
--32
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Pointer1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Pointer2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
--pointer-check
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Pointer3/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Pointer_Array1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Struct_Propagation1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
--unwind 5
^EXIT=0$
Expand Down
19 changes: 19 additions & 0 deletions regression/cbmc/address_of_struct_member/address_of.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
struct expr
{
int line;
char comment;
};

int main(int argc, char *argv[])
{
struct expr var_expr = {42, 'a'};
struct expr other_expr = {34, 'b'};
unsigned int nondet;
int *ref;
if(nondet)
ref = &var_expr.line;
else
ref = &other_expr.line;
__CPROVER_assert(*ref != 34, "expected failure: ref == 34");
return 0;
}
9 changes: 9 additions & 0 deletions regression/cbmc/address_of_struct_member/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE new-smt-backend
address_of.c

\[main\.assertion\.1\] line \d+ expected failure: ref == 34: FAILURE
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
--
26 changes: 26 additions & 0 deletions regression/cbmc/address_of_struct_member_rec/address_of_rec.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
struct aux
{
char comment;
};

struct expr
{
int line;
struct aux *info;
};

int main(void)
{
struct aux info1 = {'a'};
struct aux info2 = {'b'};
struct expr var_expr = {42, &info1};
struct expr other_expr = {34, &info2};
unsigned int nondet;
char *ref;
if(nondet)
ref = &var_expr.info->comment;
else
ref = &other_expr.info->comment;
__CPROVER_assert(*ref != 'b', "expected failure: ref == 'b'");
return 0;
}
9 changes: 9 additions & 0 deletions regression/cbmc/address_of_struct_member_rec/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE new-smt-backend
address_of_rec.c

\[main\.assertion\.1\] line \d+ expected failure: ref == 'b': FAILURE
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
--
2 changes: 1 addition & 1 deletion regression/cbmc/struct1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE gcc-only
CORE gcc-only new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct10/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct11/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct12/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
--pointer-check --bounds-check
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct13/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct14/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=10$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct15/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE smt-backend
CORE smt-backend new-smt-backend
main.c
--trace --z3
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct17/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^VERIFICATION SUCCESSFUL$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct3/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct4/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct6/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
--bounds-check --pointer-check
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct7/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c
--pointer-check --bounds-check
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct8/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/struct9/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
CORE new-smt-backend
main.c

^EXIT=0$
Expand Down

0 comments on commit cf380d5

Please sign in to comment.