diff options
author | Andy Wingo <wingo@pobox.com> | 2013-10-12 15:19:01 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-10-12 15:19:20 +0200 |
commit | 96b8027cc412ed431785a4c7ed643da2777f3263 (patch) | |
tree | 0366947ba7bd805643c6feb19d447ded83161b87 /test-suite/tests/rtl-compilation.test | |
parent | 366eb4d764cc575eb48015b4e68fefc88b22706b (diff) | |
download | guile-96b8027cc412ed431785a4c7ed643da2777f3263.tar.gz |
Identify loops
* module/language/cps/dfg.scm (compute-dom-edges)
(compute-join-edges, compute-reducible-back-edges)
(compute-irreducible-dom-levels, compute-nodes-by-level)
(mark-loop-body, mark-irreducible-loops, identify-loops): Identify
loops. Irreducible loops are TODO.
* test-suite/tests/rtl-compilation.test ("contification"): Add an
irreducible loop test.
Diffstat (limited to 'test-suite/tests/rtl-compilation.test')
-rw-r--r-- | test-suite/tests/rtl-compilation.test | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test-suite/tests/rtl-compilation.test b/test-suite/tests/rtl-compilation.test index ef4ab8d0b..d5cd81a17 100644 --- a/test-suite/tests/rtl-compilation.test +++ b/test-suite/tests/rtl-compilation.test @@ -167,7 +167,18 @@ (define (odd? x) (if (null? x) #f (even? (cdr x)))) (list (even? x)))) - '(1 2 3 4)))) + '(1 2 3 4))) + + ;; An irreducible loop between even? and odd?. + (pass-if-equal '#t + ((run-rtl '(lambda (x do-even?) + (define (even? x) + (if (null? x) #t (odd? (cdr x)))) + (define (odd? x) + (if (null? x) #f (even? (cdr x)))) + (if do-even? (even? x) (odd? x)))) + '(1 2 3 4) + #t))) (with-test-prefix "case-lambda" (pass-if-equal "simple" |