-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cfg-builder): caching of integers
This fixes issue #91
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
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
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,24 @@ | ||
// RUN: %clam --crab-dom=int --crab-lower-unsigned-icmp --crab-check=assert %s 2>&1 | OutputCheck %s | ||
// RUN: %clam --crab-dom=int --lower-unsigned-icmp --crab-check=assert %s 2>&1 | OutputCheck %s | ||
// CHECK: ^1 Number of total safe checks$ | ||
// CHECK: ^0 Number of total error checks$ | ||
// CHECK: ^0 Number of total warning checks$ | ||
|
||
|
||
extern void __CRAB_assume(int cond); | ||
extern int __CRAB_nd(void); | ||
extern void __CRAB_assert(int); | ||
|
||
int N; | ||
|
||
int main() { | ||
N = __CRAB_nd(); | ||
|
||
__CRAB_assume(N != -2147483648 && N != 2147483647); | ||
|
||
for (int i = 0; i < N; i++) { | ||
__CRAB_assert(N >= -1); | ||
} | ||
|
||
return 0; | ||
} |