aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/unused-local-1.c
blob: 361cdced6e3ab100acbe2e26f071f4400fae8352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-additional-options "-fdump-analyzer-untracked" } */

struct st
{
  const char *m_filename;
  int m_line;
  const char *m_function;
};

extern void debug (struct st *);

void test (void)
{
  {
    static struct st s1 = { __FILE__, __LINE__, __func__ }; /* { dg-warning "track 's1': no" } */
    debug (&s1);
  }
  {
    static struct st s2 = { __FILE__, __LINE__, __func__ }; /* { dg-warning "track 's2': no" } */
    debug (&s2);
  }
}