Test output for bind [ok]

Testing time: 7s

'/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/bin/csi' -script run.scm < /dev/null 2>&1
(define My_struct-x
  (foreign-lambda*
    integer
    (((c-pointer (struct "My_struct")) s))
    "return(s->x);"))
(define My_struct-y
  (getter-with-setter
    (foreign-lambda*
      float
      (((c-pointer (struct "My_struct")) s))
      "return(s->y);")
    (foreign-lambda*
      void
      (((c-pointer (struct "My_struct")) s) (float x))
      "s->y = x;")))
(define make-My_struct
  (foreign-lambda*
    (c-pointer (struct "My_struct"))
    ((integer x) (float y))
    "struct My_struct *tmp_ =  (struct My_struct *)C_malloc(sizeof(struct My_struct));\ntmp_->x = x;\ntmp_->y = y;\nreturn(tmp_);;\n"))
(begin
  (define make_struct
    (foreign-lambda*
      (c-pointer (struct "My_struct"))
      ((integer a0) (float a1))
      "return(make_struct(a0 , a1));")))
(define-constant GLU_TESS_MAX_COORD 1e+150)
(define-constant X1_1 1e+150)
(define-constant X1_2 -1e+150)
(define-constant X1_3 -1e-150)
(define-constant X1_4 1e+150)
(define-constant X1_5 -1e+150)
(define-constant X1_6 -1e-150)
(define-constant X2_1 1e+150)
(define-constant X2_2 -1e+150)
(define-constant X2_3 -1e-150)
(define-constant X2_4 1e+150)
(define-constant X2_5 -1e+150)
(define-constant X2_6 -1e-150)
(define-constant X3_1 1)
(define-constant X3_2 12)
(define-constant X3_3 -1)
(define-constant X3_4 -12)
(define-constant X4_1 1.0)
(define-constant X4_2 12.0)
(define-constant X4_3 -1.0)
(define-constant X4_4 -12.0)
(define-constant X5_1 1.0)
(define-constant X5_2 12.0)
(define-constant X5_3 -1.0)
(define-constant X5_4 -12.0)
(begin
  (declare (hide g156))
  (define g156
    (foreign-lambda* integer (((c-pointer double) a0)) "return(foo(a0));"))
  (define (bar g155)
    (let-location
      ((g161 double g155))
      (let ((g160 (g156 (location g161)))) (values g160 g161)))))
(begin
  (declare (hide g190))
  (define g190
    (foreign-lambda* integer32 (((c-pointer double) a0)) "return(two(a0));"))
  (define (two g189)
    (let-location
      ((g195 double g189))
      (let ((g194 (g190 (location g195)))) (values g194 g195)))))
(begin
  (declare (hide g229))
  (define g229
    (foreign-lambda*
      double
      ((double a0) ((c-pointer double) a1))
      "return(modf(a0 , a1));"))
  (define (modf g227)
    (let-location
      ((g235 double))
      (let ((g233 (g229 g227 (location g235)))) (values g233 g235)))))
(begin
  (declare (hide g276))
  (define g276
    (foreign-lambda*
      double
      ((f64vector a0) (integer a1))
      "return(sumarray(a0 , a1));"))
  (define (sumarray g274)
    (let-location () (let ((g280 (g276 g274 (f64vector-length g274)))) g280))))
(begin
  (define fopen
    (foreign-lambda*
      myfile
      ((c-string a0) (c-string a1))
      "return(fopen(a0 , a1));")))
(define-constant mylib:SOME_CONST 42)
In file included from tests.cpp:8:
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2907:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2922:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2933:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2971:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:3089:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:3107:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:3127:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
7 warnings generated.
(0.439999999999998 33.0)
#<myfile>
(begin (declare (hide g88)) (define-class <Foo> (<c++-object>) ()))
(begin
  (define g88 (foreign-lambda void "delete " (c-pointer "Foo")))
  (define-method (destructor (this <Foo>)) (g88 (slot-value this 'this))))
(begin
  (declare (hide g96))
  (define g96 (foreign-lambda (c-pointer "Foo") "new Foo" c-string))
  (define-method
    (constructor (this <Foo>) initargs)
    (set! (slot-value this 'this) (##sys#apply g96 initargs))))
(begin
  (declare (hide g98))
  (define g98
    (foreign-lambda*
      c-string
      (((c-pointer "Foo") g99))
      "return(g99->name());"))
  (define-method
    (name (this <Foo>) #!rest args)
    (##sys#apply g98 (slot-value this 'this) args)))
(begin
  (declare (hide g101))
  (define g101
    (foreign-lambda*
      (instance "Foo" <Foo>)
      (((c-pointer "Foo") g102) ((instance "Foo" <Foo>) g103))
      "return(g102->bar(g103));"))
  (define-method
    (bar (this <Foo>) #!rest args)
    (##sys#apply g101 (slot-value this 'this) args)))
(begin (declare (hide g380)) (define-class <Foo2> (<c++-object>) ()))
(begin
  (define g380 (foreign-lambda void "delete " (c-pointer "Foo2")))
  (define-method (destructor (this <Foo2>)) (g380 (slot-value this 'this))))
(begin
  (declare (hide g388))
  (define g388
    (foreign-lambda*
      (instance "Foo2" <Foo2>)
      (((c-pointer "Foo2") g389) (bool g390))
      "try { return(g389->bar2(g390)); } catch(...) { return(0); };"))
  (define-method
    (bar2 (this <Foo2>) #!rest args)
    (##sys#apply g388 (slot-value this 'this) args)))
(begin
  (declare (hide g392))
  (define g392 (foreign-lambda (c-pointer "Foo2") "new Foo2"))
  (define-method
    (constructor (this <Foo2>) initargs)
    (set! (slot-value this 'this) (##sys#apply g392 initargs))))
(begin
  (declare (hide g572))
  (define g572
    (foreign-lambda* integer ((integer a0)) "return(overloaded(a0));"))
  (define-method (overloaded (g571 <integer>)) (g572 g571)))
(begin
  (declare (hide g580))
  (define g580
    (foreign-lambda* integer ((c-string a0)) "return(overloaded(a0));"))
  (define-method (overloaded (g579 <string>)) (g580 g579)))
In file included from cplusplus-test.cpp:8:
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2907:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2922:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2933:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:2971:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:3089:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:3107:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/include/chicken/chicken.h:3127:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
7 warnings generated.
bind class
#<coops-instance>
#<coops-instance>
exception handler
#<coops-instance>
#<pointer 0x8023760b0>
#f
full specialization
(define point2d-x
  (foreign-lambda* float (((c-pointer (struct "point2d")) s)) "return(s->x);"))
(define point2d-y
  (foreign-lambda* float (((c-pointer (struct "point2d")) s)) "return(s->y);"))
(define make-point2d
  (foreign-lambda*
    (c-pointer (struct "point2d"))
    ((float x) (float y))
    "struct point2d *tmp_ =  (struct point2d *)C_malloc(sizeof(struct point2d));\ntmp_->x = x;\ntmp_->y = y;\nreturn(tmp_);;\n"))
(define line-a
  (lambda (s)
    (let ((destination (make-f32vector 2)))
      ((foreign-lambda*
         void
         ((f32vector dest) ((c-pointer (struct "line")) s))
         "struct point2d _r = s->a;\n*((struct point2d*)dest) = _r;\n")
       destination
       s)
      destination)))
(define line-b
  (lambda (s)
    (let ((destination (make-f32vector 2)))
      ((foreign-lambda*
         void
         ((f32vector dest) ((c-pointer (struct "line")) s))
         "struct point2d _r = s->b;\n*((struct point2d*)dest) = _r;\n")
       destination
       s)
      destination)))
(define make-line
  (foreign-lambda*
    (c-pointer (struct "line"))
    ((f32vector a) (f32vector b))
    "struct line *tmp_ =  (struct line *)C_malloc(sizeof(struct line));\ntmp_->a = *((struct point2d*)a);\ntmp_->b = *((struct point2d*)b);\nreturn(tmp_);;\n"))
(begin
  (define lensq
    (foreign-lambda*
      float
      ((f32vector a0))
      "return(lensq(*((struct point2d*)a0)));")))
(begin
  (define init_point
    (lambda ()
      (let ((destination (make-f32vector 2)))
        ((foreign-lambda*
           void
           ((f32vector dest))
           "struct point2d _r = init_point();\n*((struct point2d*)dest) = _r;\n")
         destination)
        destination))))
===== compile-time
(foreign-lambda*1149 float (((c-pointer (struct "point2d")) s)) (-> s "x"))
=>
(foreign-lambda*1149
  void
  (((c-pointer (struct "point2d")) s) (float x))
  (= (-> s "x") x))
=>
(foreign-lambda*1149 float (((c-pointer (struct "point2d")) s)) (-> s "y"))
=>
(foreign-lambda*1149
  void
  (((c-pointer (struct "point2d")) s) (float x))
  (= (-> s "y") x))
=>
(foreign-lambda*1149
  (c-pointer (struct "point2d"))
  ((float x) (float y))
  (stmt (= "struct point2d *tmp_"
           " (struct point2d *)C_malloc(sizeof(struct point2d))")
        (= (-> "tmp_" "x") x)
        (= (-> "tmp_" "y") y)
        (return tmp_)))
=>
(foreign-lambda*1149
  (struct "point2d")
  (((c-pointer (struct "line")) s))
  (-> s "a"))
=>
(foreign-lambda*1149
  (struct "point2d")
  (((c-pointer (struct "line")) s))
  (-> s "a"))
=>
(lambda (s)
  (let1151
    ((destination (make-f32vector 2)))
    ((foreign-lambda*1149
       void
       ((f32vector dest) ((c-pointer (struct "line")) s))
       "struct point2d _r = s->a;\n*((struct point2d*)dest) = _r;\n")
     destination
     s)
    destination))
(foreign-lambda*1149
  void
  (((c-pointer (struct "line")) s) ((struct "point2d") x))
  (= (-> s "a") x))
=>
(foreign-lambda*1149
  (struct "point2d")
  (((c-pointer (struct "line")) s))
  (-> s "b"))
=>
(foreign-lambda*1149
  (struct "point2d")
  (((c-pointer (struct "line")) s))
  (-> s "b"))
=>
(lambda (s)
  (let1151
    ((destination (make-f32vector 2)))
    ((foreign-lambda*1149
       void
       ((f32vector dest) ((c-pointer (struct "line")) s))
       "struct point2d _r = s->b;\n*((struct point2d*)dest) = _r;\n")
     destination
     s)
    destination))
(foreign-lambda*1149
  void
  (((c-pointer (struct "line")) s) ((struct "point2d") x))
  (= (-> s "b") x))
=>
(foreign-lambda*1149
  (c-pointer (struct "line"))
  (((struct "point2d") a) ((struct "point2d") b))
  (stmt (= "struct line *tmp_" " (struct line *)C_malloc(sizeof(struct line))")
        (= (-> "tmp_" "a") a)
        (= (-> "tmp_" "b") b)
        (return tmp_)))
=>
(foreign-lambda*1149 float (((struct "point2d") a0)) ("lensq" a0))
=>
(foreign-lambda*1149 (struct "point2d") () ("init_point"))
=>
(foreign-lambda*1149 (struct "point2d") () ("init_point"))
=>
(lambda ()
  (let1151
    ((destination (make-f32vector 2)))
    ((foreign-lambda*1149
       void
       ((f32vector dest))
       "struct point2d _r = init_point();\n*((struct point2d*)dest) = _r;\n")
     destination)
    destination))
==== runtime
plain struct return .................................................. [ PASS]
plain struct arguments ............................................... [ PASS]
nested structs ....................................................... [ PASS]