diff options
author | Richard Biener <rguenther@suse.de> | 2022-08-23 14:30:05 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-08-23 14:31:17 +0200 |
commit | fcd9671e73c877d0bd8a2c0a16cf7cf2ce93fe60 (patch) | |
tree | bddb6ea675e6e624836e9715c303b3b88af520ea /gcc | |
parent | f05e3b2c63f3307ba405900f1a80c25b2e87b0a3 (diff) | |
download | gcc-fcd9671e73c877d0bd8a2c0a16cf7cf2ce93fe60.zip gcc-fcd9671e73c877d0bd8a2c0a16cf7cf2ce93fe60.tar.gz gcc-fcd9671e73c877d0bd8a2c0a16cf7cf2ce93fe60.tar.bz2 |
New uninit testcase
I've reduced the following which doesn't seem covered in a good enough
way in the testsuite.
* gcc.dg/uninit-pred-10.c: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-pred-10.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pred-10.c b/gcc/testsuite/gcc.dg/uninit-pred-10.c new file mode 100644 index 0000000..468b4d3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pred-10.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wuninitialized" } */ + +enum demangle_component_type { + DEMANGLE_COMPONENT_NAME, + DEMANGLE_COMPONENT_REFERENCE +}; +struct demangle_component { + enum demangle_component_type type; +} d_print_comp_inner_mod_inner, *d_print_comp_inner_dc; +struct d_print_mod { + struct d_print_mod *next; +}; +struct d_print_info { + int templates; + struct d_print_mod *modifiers; +}; +void d_print_comp_inner(struct d_print_info *dpi) +{ + int saved_templates, need_template_restore = 0; + switch (d_print_comp_inner_dc->type) { + case DEMANGLE_COMPONENT_NAME: + goto modifier; + case DEMANGLE_COMPONENT_REFERENCE: + saved_templates = dpi->templates; + need_template_restore = 1; + modifier: + struct d_print_mod dpm; + dpm.next = dpi->modifiers; + d_print_comp_inner_mod_inner = *d_print_comp_inner_dc; + d_print_comp_inner(dpi); + dpi->modifiers = dpm.next; + if (need_template_restore) + dpi->templates = saved_templates; /* { dg-bogus "uninitialized" } */ + } +} |