Patchwork [PR43920,8/9] Cross-jumping - Extend search scope - test case.

login
register
mail settings
Submitter Tom de Vries
Date April 1, 2011, 4:14 p.m.
Message ID <4D95F9C9.9000401@codesourcery.com>
Download mbox | patch
Permalink /patch/89305/
State New
Headers show

Comments

Tom de Vries - April 1, 2011, 4:14 p.m.
On 04/01/2011 05:34 PM, Richard Earnshaw wrote:
> On Fri, 2011-04-01 at 16:47 +0200, Tom de Vries wrote:
> Reposting, with ChangeLog.
>
> +/* { dg-options "-march=armv7-a -mthumb -Os" } */
>
> No, use dg-require-effective-target.  The above doesn't work properly
> with multilib testing.
>

Changed it into:

+/* { dg-options "-mthumb -Os" }  */
+/* { dg-require-effective-target arm_thumb2_ok } */

Thanks,
- Tom

Patch

2011-04-01  Tom de Vries  <tom@codesourcery.com>

	PR target/43920
	* 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,29 @@ 
+/* { dg-do compile } */
+/* { dg-options "-mthumb -Os" }  */
+/* { dg-require-effective-target arm_thumb2_ok } */
+
+#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 } } */