On Fri, 31 Oct 2025, Martin Uecker wrote:
> diff --git a/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c
> b/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c
> new file mode 100644
> index 00000000000..56f7c932e6e
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c
> @@ -0,0 +1,20 @@
> +/* { dg-do compile } */
> +/* { dg-options "-std=gnu23 -Wall" } */
> +
> +[[gnu::noinline,gnu::noipa]]
> +static bool f(int n)
> +{
> + struct foo { char a[n]; };
> + struct foo x = { };
> +
> + return 0 == __builtin_memcmp(&x, &(struct foo){ }, sizeof x);
> +}
> +
> +int main()
> +{
> + if (!f(7))
> + __builtin_abort();
Is this actually meant to be a dg-do run test not a compile test, given
the code in main?
OK with that fix, assuming the test does pass execution testing.
--
Joseph S. Myers
[email protected]