Last change
on this file since 15502 was
15502,
checked in by felix winkelmann, 11 years ago

added test for inlining/capture bug

File size:
656 bytes

Line  

1  ;;; compilertests2.scm  tests for compiler with lambdalift 

2  

3  

4  ;;; rev. 12113  lambdalifting breakage, because lambdabound variables 

5  ; were incorrectly marked as global (analysis didn't walk 

6  ; "lambda" nodes correctly, due t incorrect assumption 

7  ; that "lambda" doesn't occur. Major stupidity. 

8  ; Test case by Joerg Wittenberger 

9  

10  (define (plus1 a) 

11  (define (plus b) 

12  (+ a b)) 

13  (plus 1)) 

14  

15  (assert (= 2 (plus1 1))) 

16  

17  (define (len lst) 

18  (define (len n) 

19  (if (pair? lst) 

20  (begin 

21  (set! lst (cdr lst)) 

22  (len (+ n 1))) 

23  n)) 

24  (len 0)) 

25  

26  (assert (= 3 (len '(1 2 3)))) 

Note: See
TracBrowser
for help on using the repository browser.