aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.0/gcc/testsuite/gcc.dg/torture/pr39855.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.0/gcc/testsuite/gcc.dg/torture/pr39855.c')
-rw-r--r--gcc-4.4.0/gcc/testsuite/gcc.dg/torture/pr39855.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.4.0/gcc/testsuite/gcc.dg/torture/pr39855.c b/gcc-4.4.0/gcc/testsuite/gcc.dg/torture/pr39855.c
new file mode 100644
index 000000000..6d75c38a9
--- /dev/null
+++ b/gcc-4.4.0/gcc/testsuite/gcc.dg/torture/pr39855.c
@@ -0,0 +1,24 @@
+/* PR c/39855 */
+/* { dg-do run { target { int32plus } } } */
+
+extern void abort (void);
+
+int i, j, k;
+
+int
+foo (void)
+{
+ return ++i;
+}
+
+int
+main ()
+{
+ if (__CHAR_BIT__ != 8 || sizeof (int) != 4)
+ return 0;
+ j = foo () << 30 << 2;
+ k = (unsigned) foo () >> 16 >> 16;
+ if (i != 2 || j != 0 || k != 0)
+ abort ();
+ return 0;
+}