Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / pr93695-1.c
blob529c60131ca49ec07602498bd4feb332afc40506
1 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
2 /* TODO: remove the need for this option (PR analyzer/93695). */
4 #define NELEMS 10
5 #define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0]))
7 void
8 test_1 (void)
10 int *p[NELEMS];
11 int i;
13 for (i = 0; i < ARRAY_SIZE (p); ++i)
14 p[i] = (int *) __builtin_malloc (sizeof (i));
16 for (i = 0; i < ARRAY_SIZE (p); ++i)
17 __builtin_free (p [i]);
20 void
21 test_2 (int n)
23 int **p;
24 int i;
26 p = (int **)__builtin_malloc (sizeof (int *) * n);
27 if (!p)
28 return;
30 for (i = 0; i < n; ++i)
31 p[i] = (int *) __builtin_malloc (sizeof (i));
33 for (i = 0; i < n; ++i)
34 __builtin_free (p [i]);
36 __builtin_free (p);
39 void
40 test_3 (int **p, int n)
42 int i;
43 for (i = 0; i < n; ++i)
44 p[i] = (int *) __builtin_malloc (sizeof (i));
47 void
48 test_4 (void **p, int n)
50 int i;
51 for (i = 0; i < n; ++i)
52 __builtin_free (p[i]);