blob: 49259262c4affc6f313ccf176e0bb9f0e4f92c90 [file] [log] [blame]
#include <stdlib.h>
struct union_wrapper
{
union
{
int i;
void *ptr;
} u;
};
struct union_wrapper
test_1 (void)
{
struct union_wrapper uw1;
uw1.u.ptr = malloc (1024);
return uw1;
}
struct union_wrapper
test_2 (void)
{
struct union_wrapper uw2;
uw2.u.ptr = malloc (1024);
} /* { dg-warning "leak of 'uw2.u.ptr'" } */