This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

test suite fixes: small stacks, cross testing



This patch set fixes some spurious testsuite failures when
testing on hardware with small stack size, and when testing on a
machine different to the one that dejagnu is running on.

Tested on x86-linux.

-- 
Geoff Keating <geoffk@redhat.com>

===File ~/patches/gcc-stormy-yetmoretests.patch=============
2001-11-19  Geoffrey Keating  <geoffk@redhat.com>

	* gcc.dg/cpp/cpp.exp: For testing on a remote host, copy
	across all the headers.
	* gcc.dg/format/format.exp: For testing on a remote host,
	copy format.h.

	* gcc.c-torture/execute/20011008-3.c: Allow for small STACK_SIZE.
	* gcc.c-torture/execute/930406-1.c: Likewise.
	* gcc.c-torture/execute/comp-goto-1.c: Likewise.

Index: gcc/testsuite/gcc.c-torture/execute/20011008-3.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/gcc.c-torture/execute/20011008-3.c,v
retrieving revision 1.1
diff -p -u -p -r1.1 20011008-3.c
--- gcc/testsuite/gcc.c-torture/execute/20011008-3.c	2001/10/22 08:37:02	1.1
+++ gcc/testsuite/gcc.c-torture/execute/20011008-3.c	2001/11/19 20:29:39
@@ -81,18 +81,24 @@ __db_txnlist_lsnadd(int val, DB_TXNLIST 
    return val;
 }
 
+#ifndef STACK_SIZE
+#define	VLEN	1235
+#else
+#define VLEN (STACK_SIZE/10)
+#endif
+
 int main (void)
 {
   DB_TXNLIST el;
-  DB_LSN lsn, lsn_a[1235];
+  DB_LSN lsn, lsn_a[VLEN];
   
-  el.u.l.ntxns = 1234;
+  el.u.l.ntxns = VLEN-1;
   el.u.l.lsn_array = lsn_a;
   
   if (__db_txnlist_lsnadd (0, &el, &lsn, 0) != 1)
     abort ();
   
-  if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != 1234)
+  if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != VLEN-1)
     abort ();
   
   exit (0);
Index: gcc/testsuite/gcc.c-torture/execute/930406-1.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/gcc.c-torture/execute/930406-1.c,v
retrieving revision 1.7
diff -p -u -p -r1.7 930406-1.c
--- gcc/testsuite/gcc.c-torture/execute/930406-1.c	1998/11/11 05:56:48	1.7
+++ gcc/testsuite/gcc.c-torture/execute/930406-1.c	2001/11/19 20:29:39
@@ -1,7 +1,11 @@
 f()
 {
   int x = 1;
+#if defined(STACK_SIZE)
+  char big[STACK_SIZE/2];
+#else
   char big[0x1000];
+#endif
 
   ({
     __label__ mylabel;
Index: gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c,v
retrieving revision 1.12
diff -p -u -p -r1.12 comp-goto-1.c
--- gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c	2000/12/21 22:52:31	1.12
+++ gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c	2001/11/19 20:29:39
@@ -1,6 +1,6 @@
 #include <stdlib.h>
 
-#ifndef NO_LABEL_VALUES
+#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000)
 #if __INT_MAX__ == 32767
 typedef unsigned long uint32;
 typedef signed long sint32;
Index: gcc/testsuite/gcc.dg/cpp/cpp.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/gcc.dg/cpp/cpp.exp,v
retrieving revision 1.4
diff -p -u -p -r1.4 cpp.exp
--- gcc/testsuite/gcc.dg/cpp/cpp.exp	2001/04/30 22:38:07	1.4
+++ gcc/testsuite/gcc.dg/cpp/cpp.exp	2001/11/19 20:29:39
@@ -16,6 +16,13 @@
 
 # GCC testsuite that uses the `dg.exp' driver.
 
+# There's a bunch of headers we need.
+if [is_remote host] {
+    foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
+	remote_download host $header
+    }
+}
+
 # Load support procs.
 load_lib gcc-dg.exp
 
Index: gcc/testsuite/gcc.dg/format/format.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/gcc.dg/format/format.exp,v
retrieving revision 1.2
diff -p -u -p -r1.2 format.exp
--- gcc/testsuite/gcc.dg/format/format.exp	2001/04/30 22:38:07	1.2
+++ gcc/testsuite/gcc.dg/format/format.exp	2001/11/19 20:29:40
@@ -36,6 +36,11 @@ set TORTURE_OPTIONS [list { } { -DWIDE }
 set torture_with_loops [list { } { -DWIDE } ]
 set torture_without_loops [list { } { -DWIDE } ]
 
+# Need to copy the format.h header.
+if [is_remote host] {
+    remote_download host $srcdir/$subdir/format.h
+}
+
 load_lib gcc-dg.exp
 
 dg-init
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]