aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/pr43920-2.c
blob: 7bde9daea0464982c5d627019917cb39dd776ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* { dg-do assemble } */
/* { dg-options "-mthumb -Os -save-temps" }  */
/* { dg-require-effective-target arm_thumb2_ok } */

#include <stdio.h>

extern int lseek(int, long, int);

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-not "\t(cmp|mov|orr|and)(eq|ne)\t" } } */