diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/other/pr20366.C | |
download | cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.bz2 cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/other/pr20366.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/pr20366.C | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/pr20366.C b/gcc/testsuite/g++.dg/other/pr20366.C new file mode 100644 index 000000000..36a689ebf --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr20366.C @@ -0,0 +1,80 @@ +// Test fix for PR20366 +// +// { dg-do compile { target *-*-aix* } } +// { dg-options "-D_LARGE_FILES" } +// +// cstdio includes stdio.h and undefs most of the functions declared +// therein, unfortunately this means that #define fopen fopen64 goes +// away. This tests the fix, and ensures that with -D_LARGE_FILES +// fopen et. al. are indeed aliased to the large file equivalents. +// +// There are many other #define foo foo64 in the AIX headers, but +// these all work out fine as they are not undefined in libstdc++. +// This list is probably incomplete: +// +// Symbol Return type Large file declaration. +// +// aio.h (different for different AIX versions) +// ===== +// aio_read int aio_read64(int, struct aiocb64 *); +// aio_write int aio_write64(int, struct aiocb64 *); +// lio_listio int lio_listio64(int, struct liocb64 *[], int, void *); +// aio_cancel int aio_cancel64(int, struct aiocb64 *); +// aio_suspend int aio_suspend64(int, struct aiocb64 *[]); +// +// stdio.h +// ======= +// fgetpos int fgetpos64(FILE *, fpos64_t *); +// fopen FILE *fopen64(const char *, const char *); +// freopen FILE *freopen64(const char *, const char *, FILE *); +// fseeko int fseeko64(FILE *, off64_t, int); +// fsetpos int fsetpos64(FILE *, const fpos64_t *); +// ftello off64_t ftello64(FILE *); +// +// unistd.h +// ======== +// fclear off64_t fclear64(int, off64_t); +// fsync_range int fsync_range64(int, int, off64_t, off64_t); +// ftruncate int ftruncate64(int, off64_t); +// truncate int truncate64(const char *, off64_t); +// lseek off64_t lseek64(int, off64_t, int); +// pread ssize_t pread64(int, void *, size_t, off64_t); +// pwrite ssize_t pwrite64(int, const void *, size_t, off64_t); +// +// fcntl.h +// ======= +// open int open64(const char *, int, ...); +// creat int creat64(const char *, mode_t); +// +// sys/stat.h +// ========== +// stat int stat64(const char *, struct stat64 *); +// fstat int fstat64(int, struct stat64 *); +// lstat int lstat64(const char *, struct stat64 *); +// +// stdlib.h +// ======== +// mkstemp int mkstemp64(char *); +// +// ftw.h +// ===== +// ftw int ftw64(const char *, int (*)(const char *,const struct stat64 *, int), int); +// nftw int nftw64(const char *, int (*)(const char *, const struct stat64 *, int, struct FTW*), int, int); +// +// It seems unlikely that any of these will be used (and #undef'ed) by +// libstdc++ in the future, if they are then this test and its +// associated patch to fixincludes will have to be revisited. + +#include <cstdio> + +extern "C" { +int fgetpos(FILE *, fpos64_t *); +FILE *fopen(const char *, const char *); +FILE *freopen(const char *, const char *, FILE *); +int fseeko(FILE *, off64_t, int); +int fsetpos(FILE *, const fpos64_t *); +off64_t ftello(FILE *); +} +int main() { + return 0; +} |