Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / deref-before-check-pr77425.c
blobc9be77c0553e0f63c441a97c065def9d36b83bce
1 /* Fixed in r7-2945-g61f46d0e6dd568.
2 Simplified from gcc/ipa-devirt.c. */
4 #include "../../gcc.dg/analyzer/analyzer-decls.h"
7 typedef struct odr_type_d {
8 /* .... */
9 int id;
10 /* .... */
11 } *odr_type;
12 static odr_type **odr_types_ptr;
13 #define odr_types (*odr_types_ptr) /* { dg-message "pointer 'odr_types_ptr' is dereferenced here" } */
15 int cond, other_cond;
17 odr_type some_logic ();
19 odr_type
20 get_odr_type (/* ... */)
22 /* .... */
23 odr_type val = NULL;
24 /* .... */
26 val = some_logic ();
28 /* .... */
29 if (cond)
31 /* .... */
33 else if (other_cond)
35 odr_types[val->id] = 0; /* { dg-message "in expansion of macro 'odr_types'" } */
36 /* .... */
37 if (odr_types_ptr) /* { dg-warning "check of 'odr_types_ptr' for NULL after already dereferencing it" } */
39 /* .... */
40 val->id = 42;
42 /* .... */
44 return val;