Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/analyzer/malloc-ipa-7.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
#include <stdlib.h> /**************************************************************************/ static void maybe_calls_free_1(int *q, int flag) { if (flag) free(q); /* { dg-warning "double-'free' of 'q'" } */ } void test_1(void *p) { maybe_calls_free_1(p, 1); maybe_calls_free_1(p, 1); } /**************************************************************************/ static void maybe_calls_free_2(int *q, int flag) { if (flag) free(q); /* { dg-bogus "double-'free'" } */ } void test_2(void *p) { maybe_calls_free_2(p, 0); maybe_calls_free_2(p, 0); }