Closed
Description
CBMC version: 5.50.0
Operating system: Ubuntu 20.04
Exact command line resulting in the issue: cbmc example.c, where example.c is
#include <assert.h>
int main() {
unsigned char var = 0;
assert(__builtin_clz(var) == 8);
}
What behaviour did you expect: Successful verification
What happened instead: Verification failed.
The result is unexpected because the commit that originally added support says "The result is always defined, even for zero (where the result is the bit width)". A similar thing happens if __builtin_clz
is used instead.