testsuite: Skip analyzer tests on AIX.
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / escaping-1.c
blobb3896564ef87e6183771170e4a0751f53d61f5c4
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'" "" { target c } } */
17 /* { dg-warning "escaped: 1: 'int local_1'" "" { target c++ } .-1 } */
19 /* Should be idempotent. */
20 unknown_fn (&local_1);
21 __analyzer_dump_escaped (); /* { dg-warning "escaped: 1: 'local_1'" "" { target c } } */
22 /* { dg-warning "escaped: 1: 'int local_1'" "" { target c++ } .-1 } */
24 /* Escape a static global. */
25 unknown_fn (&only_used_by_test_1);
26 __analyzer_dump_escaped (); /* { dg-warning "escaped: 2: 'local_1', 'only_used_by_test_1'" "" { target c } } */
27 /* { dg-warning "escaped: 2: 'int local_1', 'int only_used_by_test_1'" "" { target c++ } .-1 } */