fix optimizer test

This commit is contained in:
Matthew Flatt 2011-08-19 07:40:39 -06:00
parent 2f1cf64b96
commit 349c54f3c0

View File

@ -887,10 +887,21 @@
'(module m racket/base '(module m racket/base
(define x 10) (define x 10)
(define (f y) (define (f y)
(begin (list (cons y y)
x ; compiler might not determine that `x' is definitely defined (set! x x)))))
(list (cons y y)
(set! x x))))) ;; Treat access to a mutable top-level as an effect:
(test-comp '(module m racket/base
(define x 10)
(define (f y)
(let ([old x])
(list (cons y x)
(set! x old)))))
'(module m racket/base
(define x 10)
(define (f y)
(list (cons y x)
(set! x x))))
#f) #f)
(test-comp '(let ([x 1][y 2]) x) (test-comp '(let ([x 1][y 2]) x)