Skip to content

Commit

Permalink
Add test case for cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerhard committed Nov 20, 2023
1 parent 631f4fc commit 4f7eb52
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/regression/29-svcomp/32-no-ov.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// PARAM: --enable ana.int.interval --enable ana.sv-comp.enabled --enable ana.sv-comp.functions --set ana.specification "CHECK( init(main()), LTL(G ! overflow) )"

int main(){
// This is not an overflow, just implementation defined behavior on a cast
int data = ((int)(rand() & 1 ? (((unsigned)rand()<<30) ^ ((unsigned)rand()<<15) ^ rand()) : -(((unsigned)rand()<<30) ^ ((unsigned)rand()<<15) ^ rand()) - 1));
return 0;
}

0 comments on commit 4f7eb52

Please sign in to comment.