fix optimizer test
This commit is contained in:
parent
2f1cf64b96
commit
349c54f3c0
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user