-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an integration test for path satisfiability checking
- Loading branch information
1 parent
322bc81
commit 8029801
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdint.h> | ||
|
||
uint64_t g1(uint64_t x) { | ||
int i = 0; | ||
uint64_t r = x; | ||
do { | ||
r = r+1; | ||
} while ( i++ < 3 && r == 0 ); | ||
return r; | ||
} | ||
|
||
// NB the termination of the following loop | ||
// is a bit tricky because of the interaction | ||
// between short-cutting '&&' and the 'i++' | ||
// expression. | ||
uint64_t g2(uint64_t x) { | ||
int i = 0; | ||
uint64_t r = x; | ||
do { | ||
r = r+1; | ||
} while ( r == 0 && i++ < 3 ); | ||
return r; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
m <- llvm_load_module "termination.bc"; | ||
|
||
let g_spec = do { | ||
x <- crucible_fresh_var "x" (llvm_int 64); | ||
crucible_execute_func [crucible_term x]; | ||
}; | ||
|
||
crucible_llvm_verify m "g1" [] false g_spec z3; | ||
|
||
// NB: path sat checking is required for this | ||
// to terminate in a reasonable time | ||
crucible_llvm_verify m "g2" [] true g_spec z3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$SAW test.saw |