This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR43920, 8/9] Cross-jumping - Extend search scope - test case.
- From: Tom de Vries <vries at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, ebotcazou at libertysurf dot fr
- Date: Fri, 01 Apr 2011 16:56:10 +0200
- Subject: Re: [PATCH, PR43920, 8/9] Cross-jumping - Extend search scope - test case.
- References: <4D94C603.7080505@codesourcery.com> <4D94C88B.4020206@codesourcery.com> <4D94CB8C.2010905@codesourcery.com>
Reposting, with ChangeLog.
2011-04-01 Tom de Vries <tom@codesourcery.com>
PR target/43920
* testsuite/gcc.target/arm/pr43920-2.c: New test.
Index: gcc/testsuite/gcc.target/arm/pr43920-2.c
===================================================================
--- gcc/testsuite/gcc.target/arm/pr43920-2.c (revision 0)
+++ gcc/testsuite/gcc.target/arm/pr43920-2.c (revision 0)
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv7-a -mthumb -Os" } */
+
+#include <stdio.h>
+
+int getFileStartAndLength (int fd, int *start_, size_t *length_)
+{
+ int start, end;
+ size_t length;
+
+ start = lseek (fd, 0L, SEEK_CUR);
+ end = lseek (fd, 0L, SEEK_END);
+
+ if (start == -1 || end == -1)
+ return -1;
+
+ length = end - start;
+ if (length == 0)
+ return -1;
+
+ *start_ = start;
+ *length_ = length;
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "pop" 2 } } */
+/* { dg-final { scan-assembler-times "beq" 3 } } */