diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-14-O0.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-14-O0.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-14-O0.c b/gcc/testsuite/gcc.dg/uninit-14-O0.c new file mode 100644 index 000000000..abde6ca86 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-14-O0.c @@ -0,0 +1,20 @@ +/* PR 24931 */ +/* { dg-do compile } */ +/* { dg-options "-Wuninitialized" } */ + +struct p { + short x, y; +}; + +struct s { + int i; + struct p p; +}; + +struct s f() +{ + struct s s; + s.p = (struct p){}; + s.i = (s.p.x || s.p.y); + return s; +} |