summaryrefslogtreecommitdiff
path: root/test-suite/tests/cse.test
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-06-22 13:18:02 +0200
committerAndy Wingo <wingo@pobox.com>2012-06-22 13:18:02 +0200
commit0dd7c5407599b65a1a3da4b9bd8feccc715b51f7 (patch)
tree7e54c75087c5ea3f876bcb54cc49c70ec87ae0b5 /test-suite/tests/cse.test
parent747747ee06ac64c224b91e8f64f810a1159c1675 (diff)
parent2874f66017b7bfae256e85af84689d00ecc418ab (diff)
downloadguile-0dd7c5407599b65a1a3da4b9bd8feccc715b51f7.tar.gz
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts: libguile/deprecated.c libguile/ports.c libguile/ports.h libguile/strports.c test-suite/tests/cse.test
Diffstat (limited to 'test-suite/tests/cse.test')
-rw-r--r--test-suite/tests/cse.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/test-suite/tests/cse.test b/test-suite/tests/cse.test
index d09dc53db..154cc0614 100644
--- a/test-suite/tests/cse.test
+++ b/test-suite/tests/cse.test
@@ -266,4 +266,19 @@
(let ((x (car y)))
(cons x (car y)))
(let (x) (_) ((primcall car (toplevel y)))
- (primcall cons (lexical x _) (lexical x _)))))
+ (primcall cons (lexical x _) (lexical x _))))
+
+ ;; Dominating expressions only provide predicates when evaluated in
+ ;; test context.
+ (pass-if-cse
+ (let ((t (car x)))
+ (if (car x)
+ 'one
+ 'two))
+ ;; Actually this one should reduce in other ways, but this is the
+ ;; current reduction:
+ (seq
+ (primcall car (toplevel x))
+ (if (primcall car (toplevel x))
+ (const one)
+ (const two)))))