aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gnu-compoundlit-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/gnu-compoundlit-2.c20
1 files changed, 20 insertions, 0 deletions
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 0000000..dcc5775
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { 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();
+
+ return 0;
+}
+