Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / expect-1.c
blobc2f72b4ba710d97053963fd9b28fd4a455cba57f
1 #include "../../gcc.dg/analyzer/analyzer-decls.h"
3 void *test_1 (void)
5 int *p = (int *)__builtin_malloc (sizeof (int));
6 if (__builtin_expect (p != NULL, 1))
8 *p = 42;
9 return p;
11 return NULL;
14 void *test_2 (void)
16 int *p = (int *)__builtin_malloc (sizeof (int));
17 if (__builtin_expect (p == NULL, 1))
18 return NULL;
20 *p = 42;
21 return p;
24 void *test_3 (void)
26 int *p = (int *)__builtin_malloc (sizeof (int));
27 if (__builtin_expect_with_probability (p == NULL, 1, 0.5f))
28 return NULL;
30 *p = 42;
31 return p;