From: Nick Clifton Date: Tue, 12 Jan 2016 11:43:59 +0000 (+0000) Subject: re PR testsuite/68913 (gcc.dg/lto/pr61886 FAILs) X-Git-Tag: upstream/12.2.0~49574 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b832f61ed284b78d01e5e3fb9b906bccdc71aba3;p=platform%2Fupstream%2Fgcc.git re PR testsuite/68913 (gcc.dg/lto/pr61886 FAILs) PR target/68913 * gcc.dg/lto/pr61886_0.c: Rename the external function called to fread so that it will be found in all target runtimes. From-SVN: r232264 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d827695..9dbe7cc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-01-12 Nick Clifton + + PR target/68913 + * gcc.dg/lto/pr61886_0.c: Rename the external function called + to fread so that it will be found in all target runtimes. + 2016-01-12 Richard Biener PR tree-optimization/69053 diff --git a/gcc/testsuite/gcc.dg/lto/pr61886_0.c b/gcc/testsuite/gcc.dg/lto/pr61886_0.c index c583774..ce6eb98 100644 --- a/gcc/testsuite/gcc.dg/lto/pr61886_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr61886_0.c @@ -4,12 +4,15 @@ typedef __SIZE_TYPE__ size_t; typedef struct _IO_FILE FILE; -extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk") __attribute__ ((__warn_unused_result__)); -extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk") __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer"))); +#define STRING1(a) #a +#define STRING2(a) STRING1(a) + +extern size_t fread (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ (STRING2(__USER_LABEL_PREFIX__) "fread") __attribute__ ((__warn_unused_result__)); +extern size_t fread_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ (STRING2(__USER_LABEL_PREFIX__) "fread") __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer"))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t -fread (void *__restrict __ptr, size_t __size, size_t __n, +local_fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { if (__builtin_object_size (__ptr, 0) != (size_t) -1) @@ -17,9 +20,9 @@ fread (void *__restrict __ptr, size_t __size, size_t __n, if (!__builtin_constant_p (__size) || !__builtin_constant_p (__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2))) - return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); + return fread (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); if (__size * __n > __builtin_object_size (__ptr, 0)) - return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); + return fread_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); } } @@ -28,6 +31,6 @@ FILE *fp; int main () { char file_contents[4096]; - /* We shouldn't get this resolved to a call to __fread_chk_warn. */ - return fread (file_contents, 1, nmemb, fp); + /* We shouldn't get this resolved to a call to fread_warn. */ + return local_fread (file_contents, 1, nmemb, fp); }