PR tree-optimization/55060 - False un-initialized variable warnings

gcc/testsuite/ChangeLog:
	PR tree-optimization/55060
	* gcc.dg/uninit-pr55060.c: New.
This commit is contained in:
Martin Sebor 2021-03-25 17:23:06 -06:00
parent 26e80a4968
commit e88ca9f423

View File

@ -0,0 +1,30 @@
/* PR tree-optimization/55060 - False un-initialized variable warnings
{ dg-do compile }
{ dg-options "-O1 -Wuninitialized" } */
static void a(int *i) { }
static void b(int p) { }
int foo(void) {
int i;
a(&i);
b(i); // { dg-bogus "\\\[-Wuninitialized" }
return 0;
}
static void c(int *i) { }
extern void d(int p);
int bar(void) {
int i;
c(&i);
d(i); // { dg-warning "\\\[-Wuninitialized" }
return 0;
}
extern void e(int *i);
static void f(int p) {};
int baz(void) {
int i;
e(&i);
f(i); // { dg-bogus "\\\[-Wuninitialized" }
return 0;
}