1 /* Simplified version of test for ensuring we issue a FILE * leak diagnostic,
3 Adapted from intl/localealias.c, with all #includes removed. */
5 /* { dg-do "compile" } */
7 /* Handle aliases for locale names.
8 Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
10 This program is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Library General Public License as published
12 by the Free Software Foundation; either version 2, or (at your option)
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
20 You should have received a copy of the GNU Library General Public
21 License along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
25 /* Minimal version of system headers. */
26 #define NULL ((void *) 0)
27 typedef struct _IO_FILE
FILE;
28 extern FILE *fopen(const char *__restrict __filename
,
29 const char *__restrict __modes
);
30 extern int fclose(FILE *__stream
);
33 read_alias_file (int flag
)
37 fp
= fopen ("name", "r"); /* { dg-message "opened here" } */
42 return; /* { dg-warning "leak of FILE 'fp'" } */