diff --git a/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions2.rkt b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions2.rkt new file mode 100644 index 00000000..9c923800 --- /dev/null +++ b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions2.rkt @@ -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)) diff --git a/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions3.rkt b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions3.rkt new file mode 100644 index 00000000..9bc0f44c --- /dev/null +++ b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions3.rkt @@ -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)) diff --git a/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions4.rkt b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions4.rkt new file mode 100644 index 00000000..eef46901 --- /dev/null +++ b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions4.rkt @@ -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))) diff --git a/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions5.rkt b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions5.rkt new file mode 100644 index 00000000..7b685942 --- /dev/null +++ b/collects/tests/typed-scheme/optimizer/generic/unboxed-let-functions5.rkt @@ -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)))