summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/malloc-meaning-1.c
blob: 4964e25fe1086f6ab4cc486a957d3ceab99081ba (plain)
1
2
3
4
5
6
7
8
9
10
/* { dg-additional-options "-fanalyzer-verbose-state-changes" } */

#include <stdlib.h>

void test_1 (void)
{
  void *ptr = malloc (1024); /* { dg-message "meaning: \\{verb: 'acquire', noun: 'memory'\\}" } */
  free (ptr); /* { dg-message "meaning: \\{verb: 'release', noun: 'memory'\\}" } */
  free (ptr); /* { dg-warning "double-'free' of 'ptr'" } */
}