Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/memset-2.c

raw
1 /* { dg-additional-options "-fdump-analyzer-untracked" } */
2
3 #include "analyzer-decls.h"
4
5 struct S
6 {
7 int i;
8 };
9
10 /* memset of a static struct that never gets used. */
11
12 void
13 test_1 (void)
14 {
15 static struct S s; /* { dg-warning "track 's': no" } */
16 __builtin_memset (&s, 0, sizeof (s));
17 }
18
19 /* memset of a static struct that later gets used. */
20
21 void
22 test_2 (void)
23 {
24 static struct S s; /* { dg-warning "track 's': yes" } */
25 __builtin_memset (&s, 0, sizeof (s));
26 __analyzer_eval (s.i == 0); /* { dg-warning "TRUE" } */
27 }