| 1 |
/* { dg-do assemble } */ |
| 2 |
/* { dg-options "-mthumb -Os -save-temps" } */ |
| 3 |
/* { dg-require-effective-target arm_thumb2_ok } */ |
| 4 |
|
| 5 |
#include <stdio.h> |
| 6 |
|
| 7 |
extern int lseek(int, long, int); |
| 8 |
|
| 9 |
int getFileStartAndLength (int fd, int *start_, size_t *length_) |
| 10 |
{ |
| 11 |
int start, end; |
| 12 |
size_t length; |
| 13 |
|
| 14 |
start = lseek (fd, 0L, SEEK_CUR); |
| 15 |
end = lseek (fd, 0L, SEEK_END); |
| 16 |
|
| 17 |
if (start == -1 || end == -1) |
| 18 |
return -1; |
| 19 |
|
| 20 |
length = end - start; |
| 21 |
if (length == 0) |
| 22 |
return -1; |
| 23 |
|
| 24 |
*start_ = start; |
| 25 |
*length_ = length; |
| 26 |
|
| 27 |
return 0; |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-final { scan-assembler-not "\t(cmp|mov|orr|and)(eq|ne)\t" } } */ |