aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr20054.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr20054.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr20054.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr20054.c b/gcc/testsuite/gcc.dg/pr20054.c
new file mode 100644
index 00000000000..292b856d014
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr20054.c
@@ -0,0 +1,23 @@
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing" } */
+
+
+unsigned int *foo (void);
+
+char *
+bar (double *d)
+{
+ return (char *) (d + 1) - sizeof (unsigned int);
+}
+
+char
+baz (double x)
+{
+ unsigned int h = *foo ();
+ unsigned int l = *(unsigned int *) bar (&x);
+
+ return (h & ~0x80000000L) == 0x7FF00000 && l == 0;
+}
+
+