2
DONTRUN: cast not supported yet
5
#pragma SeparationPolicy(Regions)
7
/*@ axiom little_endian_low_byte_short{L}:
8
@ \forall short *s; *(char*)s == *s % 256;
10
@ axiom little_endian_high_byte_short{L}:
11
@ \forall short *s; *((char*)s+1) == *s / 256;
15
@ \forall integer i; i == 256 * (i / 256) + i % 256;
18
/*@ requires \valid_range(x,0,1);
19
@ ensures x[0] == \old(x[1]) && x[1] == \old(x[0]);
27
/*@ requires \valid(s);
28
@ ensures *s == 256 * (\old(*s) % 256) + (\old(*s) / 256);
30
void reverse_endian(short *s) {
37
compile-command: "LC_ALL=C make -j reverse_endian3"