-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CN: add some tests that didn't get committed before
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
#define BIT(n) (1UL << (n)) | ||
|
||
int | ||
f (int x) { | ||
int mask = BIT(12 - 3) - 1; | ||
|
||
return 0; | ||
} | ||
|
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,15 @@ | ||
|
||
/* this is a wrong specification. */ | ||
/* this function doesn't create an integer in memory */ | ||
|
||
int | ||
f (int *p, int x) | ||
/*@ requires x < 12 @*/ | ||
/*@ ensures return < 12 @*/ | ||
/*@ ensures take Resource_From_Nothing = Owned(p) @*/ | ||
{ | ||
return x; | ||
} | ||
|
||
|
||
|
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,22 @@ | ||
|
||
/* this is a wrong specification. */ | ||
/* this function doesn't create an integer in memory */ | ||
|
||
/*@ | ||
predicate (integer) Owned_Wrapper (pointer p) { | ||
take I = Owned<int>(p); | ||
return I; | ||
} | ||
@*/ | ||
|
||
int | ||
f (int *p, int x) | ||
/*@ requires x < 12 @*/ | ||
/*@ ensures return < 12 @*/ | ||
/*@ ensures take Resource_From_Nothing = Owned_Wrapper(p) @*/ | ||
{ | ||
return x; | ||
} | ||
|
||
|
||
|