Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / escaping-1.c
blob0d3949bac899a3cf218b66bf49058c5a93a315d6
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)
9 int local_1, local_2;
10 __analyzer_dump_escaped (); /* { dg-warning "escaped: 0: " } */
12 unknown_fn (NULL);
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'" } */