Skip to content

Commit

Permalink
Add string literal regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasspriggs committed Jul 18, 2023
1 parent 6bef976 commit 3f7e416
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions regression/cbmc-incr-smt2/arrays/string_literal.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <assert.h>
#include <stdint.h>

int main()
{
const char *my_string = "hello!";
uint8_t index;
__CPROVER_assume(index < 6);
char element = my_string[index];
assert(element != 'o');
}
13 changes: 13 additions & 0 deletions regression/cbmc-incr-smt2/arrays/string_literal.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CORE
string_literal.c
--trace
Passing problem to incremental SMT2 solving
line 10 assertion element \!\= \'o\'\: FAILURE
index=4
element='o'
VERIFICATION FAILED
^EXIT=10$
^SIGNAL=0$
--
--
Test of indexing into a string literal.

0 comments on commit 3f7e416

Please sign in to comment.