blob: ad536ce5f02f08cbfc7519adcb5aec1a5ee4791f [file] [log] [blame]
#include <stdlib.h>
void *
calls_malloc (void)
{
void *result = malloc (1024);
return result;
}
int *test_1 (int i)
{
int *ptr = (int *)calls_malloc ();
*ptr = i; /* { dg-warning "dereference of possibly-NULL 'ptr'" } */
return ptr;
}
/* Same as test_1, to exercise the caches. */
int *test_2 (int i)
{
int *ptr = (int *)calls_malloc ();
*ptr = i; /* { dg-warning "dereference of possibly-NULL 'ptr'" } */
return ptr;
}