comparison gcc/testsuite/gcc.dg/analyzer/analyzer-verbosity-2a.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 /* { dg-additional-options "-fanalyzer-verbosity=2" } */
2
3 #include <stdio.h>
4
5 extern int foo ();
6 extern void bar ();
7
8 void test (const char *path, int flag)
9 {
10 FILE *fp = fopen (path, "r"); /* { dg-message "opened here" } */
11
12 /* We shouldn't report this control flow at -fanalyzer-verbosity=2. */
13 if (foo ()) /* { dg-bogus "" } */
14 bar ();
15 else
16 bar ();
17
18 if (flag) /* { dg-message "when 'flag == 0'" } */
19 fclose (fp);
20 } /* { dg-warning "leak of FILE 'fp'" } */