summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-05-11 11:05:30 +0200
committerAndy Wingo <wingo@pobox.com>2020-05-11 11:05:30 +0200
commit21885aa4babd29b118e3e5f99c6b769d03831735 (patch)
treec147b11909aa5f3d0e279995c1d1b6a06a3848e7 /test-suite
parent2e6f2feefc8c7f2027299a10ada2307fb6deb430 (diff)
downloadguile-21885aa4babd29b118e3e5f99c6b769d03831735.tar.gz
Test suite compile-and-eval tests run -O0 and -O2
* test-suite/test-suite/lib.scm (c&e): Test -O0 and -O2.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/test-suite/lib.scm33
1 files changed, 22 insertions, 11 deletions
diff --git a/test-suite/test-suite/lib.scm b/test-suite/test-suite/lib.scm
index b2cbb1faa..6d15ccc68 100644
--- a/test-suite/test-suite/lib.scm
+++ b/test-suite/test-suite/lib.scm
@@ -1,5 +1,5 @@
;;;; test-suite/lib.scm --- generic support for testing
-;;;; Copyright (C) 1999-2001,2004,2006-2007,2009-2014,2018
+;;;; Copyright (C) 1999-2001,2004,2006-2007,2009-2014,2016,2018,2020
;;;; Free Software Foundation, Inc.
;;;;
;;;; This program is free software; you can redistribute it and/or
@@ -466,20 +466,31 @@
(c&e (pass-if "[unnamed test]" exp)))
((_ (pass-if test-name exp))
(begin (pass-if (string-append test-name " (eval)")
- (primitive-eval 'exp))
- (pass-if (string-append test-name " (compile)")
- (compile 'exp #:to 'value #:env (current-module)))))
+ (primitive-eval 'exp))
+ (pass-if (string-append test-name " (compile -O0)")
+ (compile 'exp #:to 'value #:env (current-module)
+ #:optimization-level 0))
+ (pass-if (string-append test-name " (compile -O2)")
+ (compile 'exp #:to 'value #:env (current-module)
+ #:optimization-level 2))))
((_ (pass-if-equal test-name val exp))
(begin (pass-if-equal (string-append test-name " (eval)") val
(primitive-eval 'exp))
- (pass-if-equal (string-append test-name " (compile)") val
- (compile 'exp #:to 'value #:env (current-module)))))
+ (pass-if-equal (string-append test-name " (compile -O0)") val
+ (compile 'exp #:to 'value #:env (current-module)
+ #:optimization-level 0))
+ (pass-if-equal (string-append test-name " (compile -O2)") val
+ (compile 'exp #:to 'value #:env (current-module)
+ #:optimization-level 2))))
((_ (pass-if-exception test-name exc exp))
- (begin (pass-if-exception (string-append test-name " (eval)")
- exc (primitive-eval 'exp))
- (pass-if-exception (string-append test-name " (compile)")
- exc (compile 'exp #:to 'value
- #:env (current-module)))))))
+ (begin (pass-if-exception (string-append test-name " (eval)") exc
+ (primitive-eval 'exp))
+ (pass-if-exception (string-append test-name " (compile -O0)") exc
+ (compile 'exp #:to 'value #:env (current-module)
+ #:optimization-level 0))
+ (pass-if-exception (string-append test-name " (compile -O2)") exc
+ (compile 'exp #:to 'value #:env (current-module)
+ #:optimization-level 2))))))
;;; (with-test-prefix/c&e PREFIX BODY ...)
;;; Same as `with-test-prefix', but the enclosed tests are run both with