middle-end: Fix stalled swapped condition code value [PR115836]
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / null-deref-pr110520.c
blobb57027689eededd25eefe1e51961ee3d1a1a1946
1 #include "analyzer-decls.h"
3 int main(void) {
4 char buf[] = "0";
5 int *ptr = (int *)(__builtin_strlen(buf) - 1);
6 __analyzer_eval((__builtin_strlen(buf)) == 1); /* { dg-warning "TRUE" } */
7 *ptr = 10086; /* { dg-warning "dereference of NULL 'ptr'" } */