diff gcc/testsuite/gcc.dg/torture/pr93946-1.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/torture/pr93946-1.c	Mon May 25 07:50:57 2020 +0900
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+union U { long long i; long f; };
+struct a {union U u;};
+struct aa {struct a a;};
+struct b {union U u;};
+struct bb {struct b b;};
+
+long __attribute__((noipa))
+foo (struct bb *bv, void *ptr)
+{
+  struct aa *a = ptr;
+  struct bb *b = ptr;
+  bv->b.u.f = 1;
+  a->a.u.i = 0;
+  b->b.u.f = 0;
+  return bv->b.u.f;
+}
+
+int
+main ()
+{
+  union C {struct aa aa; struct bb bb;} v;
+  if (foo (&v.bb, &v) != 0)
+    __builtin_abort ();
+  return 0;
+}