diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr25310.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr25310.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr25310.c b/gcc/testsuite/gcc.c-torture/compile/pr25310.c new file mode 100644 index 000000000..71081d821 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr25310.c @@ -0,0 +1,22 @@ + +/* Prevent spurious test failures on 16-bit targets. */ +#if __INT_MAX__ >= 2147483647L + +extern int f (char *, int); + +void test (void) +{ + char buffer[65536]; + char *bufptr; + char *bufend; + int bytes; + + bufptr = buffer; + bufend = buffer + sizeof(buffer) - 1; + + while ((bytes = f (bufptr, bufend - bufptr)) > 0) + bufptr += bytes; +} + +#endif + |