Fix out-of-memory test for top-level inlining
authorAndy Wingo <wingo@pobox.com>
Sun, 25 Aug 2019 19:44:46 +0000 (21:44 +0200)
committerAndy Wingo <wingo@pobox.com>
Sun, 25 Aug 2019 19:47:18 +0000 (21:47 +0200)
* test-suite/standalone/test-out-of-memory: Prevent the test harness
  from being inlined.  If the test harness is inlined, it might cause
  the optimizer to omit the allocations being tested!

test-suite/standalone/test-out-of-memory

index 221651270195be087d07c4bc9193ac87754507c2..31375a559e8f46de0c76d65b141c079a92dc7102 100755 (executable)
@@ -36,7 +36,7 @@ exec guile -q -s "$0" "$@"
   (lambda (k . args)
     (print-exception (current-error-port) #f k args)
     (write "Skipping test.\n" (current-error-port))
-    (exit 0)))
+    (exit 77))) ; unresolved
 
 ;; 50 MB.
 (define *limit* (* 50 1024 1024))
@@ -54,6 +54,10 @@ exec guile -q -s "$0" "$@"
     (lambda _
       #t)))
 
+;; Prevent `test' from being inlined, which might cause an unused
+;; allocation to be omitted.
+(set! test test)
+
 (use-modules (rnrs bytevectors))
 
 (test (lambda ()