IRA: Ignore debug insns for uses in split_live_ranges_for_shrink_wrap. [PR116179]
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / pr93355-localealias-simplified.c
blob6f65add346b88f81c8c896571084a683ccc592b8
1 /* Simplified version of test for ensuring we issue a FILE * leak diagnostic,
2 made trivial.
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)
13 any later version.
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,
23 USA. */
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);
32 void
33 read_alias_file (int flag)
35 FILE *fp;
37 fp = fopen ("name", "r"); /* { dg-message "opened here" } */
38 if (fp == NULL)
39 return;
41 if (flag)
42 return; /* { dg-warning "leak of FILE 'fp'" } */
44 fclose (fp);