Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/null-terminated-strings-2.c

raw
1 #include "../../gcc.dg/analyzer/analyzer-decls.h"
2
3 char buf[16];
4
5 int main (void)
6 {
7 /* We should be able to assume that "buf" is all zeroes here. */
8
9 __analyzer_eval (__analyzer_get_strlen (buf) == 0); /* { dg-warning "TRUE" "ideal" { xfail *-*-* } } */
10 /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
11
12 buf[0] = 'a';
13 __analyzer_eval (__analyzer_get_strlen (buf) == 1); /* { dg-warning "TRUE" "ideal" { xfail *-*-* } } */
14 /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
15
16 return 0;
17 }