PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pr43920-2.c
blobf5e8f4837c6d7174ee7d82fe889b1fb2da15fe7f
1 /* { dg-do assemble } */
2 /* { dg-options "-mthumb -Os -save-temps" } */
3 /* { dg-require-effective-target arm_thumb2_ok } */
5 #include <stdio.h>
7 extern int lseek(int, long, int);
9 int getFileStartAndLength (int fd, int *start_, size_t *length_)
11 int start, end;
12 size_t length;
14 start = lseek (fd, 0L, SEEK_CUR);
15 end = lseek (fd, 0L, SEEK_END);
17 if (start == -1 || end == -1)
18 return -1;
20 length = end - start;
21 if (length == 0)
22 return -1;
24 *start_ = start;
25 *length_ = length;
27 return 0;
30 /* { dg-final { scan-assembler-times "pop" 2 } } */
31 /* { dg-final { scan-assembler-times "beq" 3 } } */
32 /* { dg-final { object-size text <= 54 } } */