summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test-suite/ChangeLog5
-rw-r--r--test-suite/tests/gc.test13
2 files changed, 16 insertions, 2 deletions
diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog
index 5040c164d..212c67af2 100644
--- a/test-suite/ChangeLog
+++ b/test-suite/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-15 Ludovic Courtès <ludo@gnu.org>
+
+ * tests/gc.test (gc): Add hack to clean up the stack so that the
+ test passes on SPARC.
+
2008-02-01 Neil Jerram <neil@ossau.uklinux.net>
* standalone/Makefile.am: Add stanza for test-with-guile-module.
diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
index abd714b9a..badf2b79c 100644
--- a/test-suite/tests/gc.test
+++ b/test-suite/tests/gc.test
@@ -1,5 +1,5 @@
;;;; gc.test --- test guile's garbage collection -*- scheme -*-
-;;;; Copyright (C) 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
+;;;; Copyright (C) 2000, 2001, 2004, 2006, 2008 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -63,8 +63,17 @@
((dummy (gc))
(last-count (cdr (assoc
"eval-closure" (gc-live-object-stats)))))
-
+
(for-each (lambda (x) (make-module)) (iota 1000))
+
+ ;; XXX: This hack aims to clean up the stack to make sure we
+ ;; don't leave a reference to one of the modules we created. It
+ ;; proved to be useful on SPARC:
+ ;; http://lists.gnu.org/archive/html/guile-devel/2008-02/msg00006.html .
+ (let cleanup ((i 10))
+ (and (> i 0)
+ (begin (cleanup (1- i)) i)))
+
(gc)
(gc) ;; twice: have to kill the weak vectors.
(= last-count (cdr (assoc "eval-closure" (gc-live-object-stats)))))