-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CN: Add support for bitwise subtraction
Fixes #255 Though the test looks like it is for pointer difference, the actual issue is that the elaboration has `array_shift( a_533, signed int, 0 - a_534)`, and it is the `0 - a534` which was causing the error. In principle we can/should have pure subtraction at integer and real types as well, but this can be generalised later as and when the need arises.
- Loading branch information
Showing
2 changed files
with
16 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,11 @@ | ||
int* f(int *p) | ||
/*@ ensures ptr_eq(return, array_shift(p, -1i32)); @*/ | ||
{ | ||
return p - 1; | ||
} | ||
|
||
int main(void) | ||
{ | ||
int arr = 0; | ||
f(&arr + 1); | ||
} |