Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / symbolic-5.c
blob3f696503606f085049ca92364dbc497dcc9ae326
1 #include "analyzer-decls.h"
3 int a[1024];
4 int b[1024];
6 extern void escape (void *ptr);
8 void test_1 (int *p)
10 int c, d;
11 escape (&c);
12 a[16] = 42;
13 b[16] = 17;
14 c = 33;
15 d = 44;
16 __analyzer_eval (a[16] == 42); /* { dg-warning "TRUE" } */
17 __analyzer_eval (b[16] == 17); /* { dg-warning "TRUE" } */
18 __analyzer_eval (c == 33); /* { dg-warning "TRUE" } */
19 __analyzer_eval (d == 44); /* { dg-warning "TRUE" } */
21 /* Write through an externally-provided pointer. */
22 *p = 100;
23 /* It could clobber our writes to the global arrays... */
24 __analyzer_eval (a[16] == 42); /* { dg-warning "UNKNOWN" } */
25 __analyzer_eval (b[16] == 17); /* { dg-warning "UNKNOWN" } */
26 /* ...but can't clobber locals, even ones like "c" that have escaped. */
27 __analyzer_eval (c == 33); /* { dg-warning "TRUE" } */
28 __analyzer_eval (d == 44); /* { dg-warning "TRUE" } */