20010328-1.c: New test.
authorPhilip Blundell <philb@gnu.org>
Wed, 28 Mar 2001 17:46:52 +0000 (17:46 +0000)
committerPhil Blundell <pb@gcc.gnu.org>
Wed, 28 Mar 2001 17:46:52 +0000 (17:46 +0000)
2001-03-28  Philip Blundell  <philb@gnu.org>

* gcc.c-torture/compile/20010328-1.c: New test.

From-SVN: r40934

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20010328-1.c [new file with mode: 0644]

index be5f372303302e397d9b1f3563b460d50c280668..698ec4bb3289172cbb2bf1c43de2bb925b9bfa06 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-28  Philip Blundell  <philb@gnu.org>
+
+       * gcc.c-torture/compile/20010328-1.c: New test.
+
 2001-03-27  Richard Henderson  <rth@redhat.com>
 
        * g++.old-deja/g++.eh/crash3.C: Don't use -fsjlj-exceptions.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010328-1.c b/gcc/testsuite/gcc.c-torture/compile/20010328-1.c
new file mode 100644 (file)
index 0000000..d92c6da
--- /dev/null
@@ -0,0 +1,80 @@
+typedef unsigned int size_t;
+typedef unsigned int __u_int;
+typedef unsigned long __u_long;
+
+__extension__ typedef unsigned long long int __u_quad_t;
+__extension__ typedef long long int __quad_t;
+
+typedef struct
+  {
+    int __val[2];
+  } __fsid_t;
+
+typedef long int __blksize_t;
+typedef long int __blkcnt_t;
+typedef __quad_t __blkcnt64_t;
+typedef __u_long __fsblkcnt_t;
+typedef __u_quad_t __fsblkcnt64_t;
+typedef __u_long __fsfilcnt_t;
+typedef __u_quad_t __fsfilcnt64_t;
+typedef __u_quad_t __ino64_t;
+
+extern void *memcpy (void *__restrict __dest,
+                     __const void *__restrict __src, size_t __n) ;
+
+struct statfs
+  {
+    int f_type;
+    int f_bsize;
+
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+
+    __fsid_t f_fsid;
+    int f_namelen;
+    int f_spare[6];
+  };
+
+
+struct statfs64
+  {
+    int f_type;
+    int f_bsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsid_t f_fsid;
+    int f_namelen;
+    int f_spare[6];
+  };
+
+extern int __statfs (__const char *__file, struct statfs *__buf);
+extern int __statfs64 (__const char *__file, struct statfs64 *__buf);
+
+
+int
+__statfs64 (const char *file, struct statfs64 *buf)
+{
+  struct statfs buf32;
+
+  if (__statfs (file, &buf32) < 0)
+    return -1;
+
+  buf->f_type = buf32.f_type;
+  buf->f_bsize = buf32.f_bsize;
+  buf->f_blocks = buf32.f_blocks;
+  buf->f_bfree = buf32.f_bfree;
+  buf->f_bavail = buf32.f_bavail;
+  buf->f_files = buf32.f_files;
+  buf->f_ffree = buf32.f_ffree;
+  buf->f_fsid = buf32.f_fsid;
+  buf->f_namelen = buf32.f_namelen;
+  memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
+
+  return 0;
+}