aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c
new file mode 100644
index 000000000..db5f3e0ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-options "-fno-early-inlining" } */
+
+extern void abort (void);
+
+union U
+{
+ int i;
+ _Bool b;
+};
+
+_Bool gb;
+
+void __attribute__ ((noinline))
+use_bool (union U u)
+{
+ gb = u.b;
+}
+
+union U
+bar (void)
+{
+ union U u;
+ u.i = 0xFFFE;
+ return u;
+}
+
+union U __attribute__ ((noinline))
+foo (void)
+{
+ union U u,v;
+
+ u.b = 1;
+ use_bool (u);
+ u = bar ();
+
+ return u;
+}
+
+int main (int argc, char **argv)
+{
+ union U u = foo ();
+ if (u.i != 0xFFFE)
+ abort ();
+ return 0;
+}