summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/short-compare-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/short-compare-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/short-compare-2.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/short-compare-2.c b/gcc/testsuite/gcc.dg/short-compare-2.c
new file mode 100644
index 000000000..0026a88c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/short-compare-2.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/19296 */
+/* Origin: Falk Hueffner <falk@debian.org> */
+/* Testcase by Andrew Pinski <pinskia@gcc.gnu.org> */
+
+/* { dg-do run } */
+/* { dg-options "-O" } */
+/* { dg-options "-O -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+extern void abort();
+
+void f(unsigned short ad)
+{
+ if ((short) (ad - 0x4000) >= 0)
+ abort();
+}
+
+int main(void)
+{
+ f(0xc000);
+ return 0;
+}