This contract verifies as safe, but it seems it should not, since the assertion in main() does not follow from the post-condition for foo(). If you change the contract to "ensures x >= 0", it seems to verify.
int x;
/*@
ensures x > 0;
*/
void foo(){
x =2;
}
void main() {
foo();
assert(x == 2);
}