aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c
new file mode 100644
index 000000000..a1daa7b85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+unsigned short __attribute__((noinline))
+foo (int i)
+{
+ if (i >= 0
+ && i <= 0x400000)
+ return (unsigned short)(signed char)i;
+ return i;
+}
+int main()
+{
+ int i;
+ for (i = 0; i < 0xffff; ++i)
+ if (foo(i) != (unsigned short)(signed char) i)
+ abort ();
+ return 0;
+}