More tests for unboxed args of let-bound functions.

original commit: bb144249183f8e287a37a1590df5a5aa219862f8
This commit is contained in:
Vincent St-Amour 2010-07-27 21:04:55 -04:00
parent da5586ca57
commit 7c875c3bb2
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#lang typed/scheme #:optimize
(require racket/unsafe/ops)
;; function with multiple complex args
(let ((f (lambda: ((x : Inexact-Complex) (y : Inexact-Complex))
(+ x y))))
(f (+ 1.0+2.0i 2.0+4.0i)
3.0+6.0i))

View File

@ -0,0 +1,9 @@
#lang typed/scheme #:optimize
(require racket/unsafe/ops)
;; function with a mix of complex and non-complex args
(let ((f (lambda: ((x : Inexact-Complex) (y : Float))
(+ x y))))
(f (+ 1.0+2.0i 2.0+4.0i)
3.0))

View File

@ -0,0 +1,9 @@
#lang typed/scheme #:optimize
(require racket/unsafe/ops)
;; function with a mix of complex and non-complex args, non-complex first
(let ((f (lambda: ((y : Float) (x : Inexact-Complex))
(+ x y))))
(f 3.0
(+ 1.0+2.0i 2.0+4.0i)))

View File

@ -0,0 +1,10 @@
#lang typed/scheme #:optimize
(require racket/unsafe/ops)
;; invalid: f "escapes", according to our analysis
(letrec: ((f : (Inexact-Complex -> Inexact-Complex)
(lambda: ((x : Inexact-Complex))
(let: ((y : (Inexact-Complex -> Inexact-Complex) f))
x))))
(f (+ 1.0+2.0i 2.0+4.0i)))