Skip to content

Commit 596c489

Browse files
committed
Add an integration test for path satisfiability checking
1 parent 6036705 commit 596c489

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed
3.58 KB
Binary file not shown.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <stdint.h>
2+
3+
uint64_t g1(uint64_t x) {
4+
int i = 0;
5+
uint64_t r = x;
6+
do {
7+
r = r+1;
8+
} while ( i++ < 3 && r == 0 );
9+
return r;
10+
}
11+
12+
// NB the termination of the following loop
13+
// is a bit tricky because of the interaction
14+
// between short-cutting '&&' and the 'i++'
15+
// expression.
16+
uint64_t g2(uint64_t x) {
17+
int i = 0;
18+
uint64_t r = x;
19+
do {
20+
r = r+1;
21+
} while ( r == 0 && i++ < 3 );
22+
return r;
23+
}

intTests/test0061_path_sat/test.saw

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
m <- llvm_load_module "termination.bc";
2+
3+
let g_spec = do {
4+
x <- crucible_fresh_var "x" (llvm_int 64);
5+
crucible_execute_func [crucible_term x];
6+
};
7+
8+
crucible_llvm_verify m "g1" [] false g_spec z3;
9+
10+
// NB: path sat checking is required for this
11+
// to terminate in a reasonable time
12+
crucible_llvm_verify m "g2" [] true g_spec z3;

intTests/test0061_path_sat/test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$SAW test.saw

0 commit comments

Comments
 (0)