memtst.c: Reduce size of array when STACK_SIZE is defined.
authorJeffrey A Law <law@cygnus.com>
Fri, 21 Aug 1998 23:30:36 +0000 (23:30 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 21 Aug 1998 23:30:36 +0000 (17:30 -0600)
        * gcc.c-torture/unsorted/memtst.c: Reduce size of array when
        STACK_SIZE is defined.
        * gcc.c-torture/unsorted/stuct.c: Similarly.
Makes targets with 16bit address spaces happy.

From-SVN: r21900

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/unsorted/memtst.c
gcc/testsuite/gcc.c-torture/unsorted/stuct.c

index 26ae47a6ec65cd79d6ca936344351c47edd796c1..e9b2b78b191737c36880cd9017a39cc13f890e25 100644 (file)
@@ -1,5 +1,9 @@
 Fri Aug 21 23:59:18 1998  Jeffrey A Law  (law@cygnus.com)
 
+       * gcc.c-torture/unsorted/memtst.c: Reduce size of array when
+       STACK_SIZE is defined.
+       * gcc.c-torture/unsorted/stuct.c: Similarly.
+
        * gcc.c-torture/compile/980821-1.c: New test.
 
 Fri Aug 21 03:14:04 1998  Jeffrey A Law  (law@cygnus.com)
index b345ba00b3c90483e0c87b40152d0da96c24e0b7..b5ef2607073fbb38a99411dfa9f2740747aa8296 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef STACK_SIZE
+#define SIZE STACK_SIZE / 8
+#else
+#define SIZE 65536
+#endif
+
 memtst (int *p, int a)
 {
   do
@@ -10,11 +16,11 @@ memtst (int *p, int a)
 
 main ()
 {
-  int a[65536];
+  int a[SIZE];
   int i;
-  bzero (a, 65536 * 4);
+  bzero (a, SIZE * 4);
   for (i = 0;  i < 100;  i++)
     {
-      memtst (a, 65536);
+      memtst (a, SIZE);
     }
 }
index bf7e2329bd9d118ba617cb71ca815064bb4629da..acaadf277b907f99fd03e54cefd1b24d84534d5a 100644 (file)
@@ -1,7 +1,13 @@
+#ifdef STACK_SIZE
+#define SIZE STACK_SIZE / 8
+#else
+#define STACK_SIZE 10000000
+#endif
+
 struct foo
 {
   int a, b, c;
-  int arr[10000000];
+  int arr[SIZE];
 };
 
 struct foo s, ss;