| 1 |
/* { dg-additional-options "-fdump-analyzer-untracked" } */ |
| 2 |
|
| 3 |
#include "analyzer-decls.h" |
| 4 |
|
| 5 |
struct S |
| 6 |
{ |
| 7 |
char buf[10]; |
| 8 |
}; |
| 9 |
|
| 10 |
/* strcpy to a static struct that never gets used. */ |
| 11 |
|
| 12 |
void |
| 13 |
test_1 (const char *src) |
| 14 |
{ |
| 15 |
static struct S s; /* { dg-warning "track 's': no" } */ |
| 16 |
__builtin_strcpy (s.buf, src); |
| 17 |
} |
| 18 |
|
| 19 |
/* strcpy to a static struct that later gets used. */ |
| 20 |
|
| 21 |
const char * |
| 22 |
test_2 (const char *src) |
| 23 |
{ |
| 24 |
static struct S s; /* { dg-warning "track 's': yes" } */ |
| 25 |
__builtin_strcpy (s.buf, src); |
| 26 |
return s.buf; |
| 27 |
} |