1 #include "../../gcc.dg/analyzer/analyzer-decls.h"
3 extern void unknown_fn (void *);
5 static int only_used_by_test_1
;
7 static void test_1 (void)
10 __analyzer_dump_escaped (); /* { dg-warning "escaped: 0: " } */
13 __analyzer_dump_escaped (); /* { dg-warning "escaped: 0: " } */
15 unknown_fn (&local_1
);
16 __analyzer_dump_escaped (); /* { dg-warning "escaped: 1: 'local_1'" } */
18 /* Should be idempotent. */
19 unknown_fn (&local_1
);
20 __analyzer_dump_escaped (); /* { dg-warning "escaped: 1: 'local_1'" } */
22 /* Escape a static global. */
23 unknown_fn (&only_used_by_test_1
);
24 __analyzer_dump_escaped (); /* { dg-warning "escaped: 2: 'local_1', 'only_used_by_test_1'" } */