blob: 0d868017ce69a99d2069c952eeea9db610b5c019 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
/* { dg-additional-options "-fno-exceptions" } */
#include <stdlib.h>
#include "../../gcc.dg/analyzer/analyzer-decls.h"
extern void foo (int *);
void test (int n)
{
__analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
for (int i = 0; i < n; i++)
{
int *ptr = (int *)malloc (sizeof (int) * i);
foo (ptr);
free (ptr);
__analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
}
__analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
|