Add cross-compilation test.
authorTaylor R Campbell <campbell@mumble.net>
Sat, 8 Dec 2018 06:12:18 +0000 (06:12 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 8 Dec 2018 06:12:18 +0000 (06:12 +0000)
tests/compiler/test-toplev.scm

index 4a047a9a811d6c9ef1e58f821d2ed1bd413dd46b..61a7e59224e5716f104de728122a1019497e4ba2 100644 (file)
@@ -41,4 +41,22 @@ USA.
           (compiled-expression (compile-scode scode))
           (procedure (eval compiled-expression test-env)))
       (assert-compiled-procedure procedure)
+      (assert-eqv (procedure 123.) 247.))))
+
+(define-test 'cross-example-with-flonum-data
+  (lambda ()
+    ;; XXX whattakludge
+    (define finish-cross-compilation:scode
+      (let ((env (make-top-level-environment)))
+       (load "../src/compiler/base/crsend" env)
+       (eval 'finish-cross-compilation:scode env)))
+    (let* ((code '(lambda (x) (flo:+ (flo:* 2. x) 1.)))
+          (scode (syntax&integrate code '((usual-integrations)) test-env))
+          (cross-compilation
+           (fluid-let ((compiler:cross-compiling? #t))
+             (compile-scode scode)))
+          (compiled-expression
+           (finish-cross-compilation:scode cross-compilation))
+          (procedure (eval compiled-expression test-env)))
+      (assert-compiled-procedure procedure)
       (assert-eqv (procedure 123.) 247.))))
\ No newline at end of file