Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/pr89061.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
line wrap: on
line source
/* PR c/89061 */ /* { dg-do compile } */ /* { dg-options "-Wjump-misses-init" } */ struct S { int s; }; int foo (int x) { struct S s = { 0 }; if ((s.s = x) == 0) goto cleanup; /* { dg-bogus "jump skips variable initialization" } */ s = (struct S) { .s = 42 }; cleanup: return s.s; } int bar (int x) { struct S *s = &(struct S) { 0 }; if ((s->s = x) == 0) goto cleanup; /* { dg-bogus "jump skips variable initialization" } */ s = &(struct S) { .s = 42 }; cleanup: return s->s; }