Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / dot-output.c
blobb1badd7e49d335ba36bdff0d014511b50669eab9
1 /* Verify that the various .dot output files from the analyzer are readable
2 by .dot. */
4 /* { dg-require-dot "" } */
5 /* { dg-additional-options "-fdump-analyzer-callgraph -fdump-analyzer-exploded-graph -fdump-analyzer-state-purge -fdump-analyzer-supergraph -fdump-analyzer-feasibility" } */
7 #include <stdlib.h>
9 int some_call (int i, char ch)
11 return i * i;
14 int *test (int *buf, int n, int *out)
16 int i;
17 int *result = (int *) malloc (sizeof (int) * n);
19 /* A loop, to ensure we have phi nodes. */
20 for (i = 0; i < n; i++)
21 result[i] = buf[i] + i; /* { dg-warning "possibly-NULL" } */
23 /* Example of a "'" (to test quoting). */
24 *out = some_call (i, 'a');
26 return result;
29 /* Test that we can generate valid .dot files given a BB with no
30 statements. */
31 extern int func ();
32 int test_2 (void)
34 int c1;
37 c1 = func ();
38 if (c1 == '\0')
39 break;
41 while (c1);
42 return c1;
45 /* { dg-final { dg-check-dot "dot-output.c.callgraph.dot" } } */
46 /* { dg-final { dg-check-dot "dot-output.c.eg.dot" } } */
47 /* { dg-final { dg-check-dot "dot-output.c.state-purge.dot" } } */
48 /* { dg-final { dg-check-dot "dot-output.c.supergraph.dot" } } */
49 /* { dg-final { dg-check-dot "dot-output.c.supergraph-eg.dot" } } */