diff gcc/testsuite/g++.dg/other/pr89692.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/other/pr89692.C	Thu Feb 13 11:34:05 2020 +0900
@@ -0,0 +1,20 @@
+// PR lto/89692
+// { dg-do compile }
+// { dg-require-effective-target lto }
+// { dg-options "-flto -O2" }
+
+struct S {
+  short int a, b;
+  unsigned char c : 1;
+};
+
+bool
+foo (void)
+{
+  unsigned char d[sizeof (S)] = { 0 };
+  S e;
+
+  __builtin_memcpy (&e, d, sizeof (d));
+
+  return e.c == d[0];
+}