Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / malloc-paths-3.c
blob8f9e4cff6e2b26a95d054d2b36ac2ccf80e4fb16
1 /* Verify that we emit sane paths for state machine errors. */
3 #include <stdlib.h>
5 int *test_3 (void)
7 int *ptr = (int *)malloc (sizeof (int)); /* { dg-line malloc } */
8 *ptr = 42; /* { dg-line unchecked_deref } */
9 return ptr;
11 /* { dg-warning "dereference of possibly-NULL 'ptr'" "warning" { target *-*-* } unchecked_deref } */
12 /* { dg-message "\\(1\\) this call could return NULL" "event 1" { target *-*-* } malloc } */
13 /* { dg-message "\\(2\\) 'ptr' could be NULL" "event 2" { target *-*-* } unchecked_deref } */