Skip to content

Commit

Permalink
[aarch64] add size check for pointer/double/integer
Browse files Browse the repository at this point in the history
  • Loading branch information
YoheiKakiuchi committed Jan 6, 2017
1 parent 30ce4f2 commit 0dfb09e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contrib/eus64-check/eus64-test.l
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,27 @@
:integer :integer) :float)
(defforeign call-ifunc *testmod* "call_ifunc" () :integer)
(defforeign call-ffunc *testmod* "call_ffunc" () :float)

(defforeign get-size-pointer *testmod* "get_size_of_pointer" () :integer)
(defforeign get-size-float32 *testmod* "get_size_of_float32" () :integer)
(defforeign get-size-double *testmod* "get_size_of_double" () :integer)
(defforeign get-size-long *testmod* "get_size_of_long" () :integer)
(defforeign get-size-int *testmod* "get_size_of_int" () :integer)
)

(format t "~%;;;; pointer size check ;;;;~%")

(format t "pointer size ~D ~D~%"
lisp::sizeof-* (get-size-pointer))
(format t "double size ~D ~D~%"
lisp::sizeof-double (get-size-double))
(format t "long integer size ~D ~D~%"
(cadr (assoc :long lisp::sizeof-types))
(get-size-long))
(format t "integer size ~D ~D~%"
lisp::sizeof-int (get-size-int))
(format t "float size ~D ~D~%"
lisp::sizeof-float (get-size-float32))

(format t "~%multiple arguments passing~%")
(format t "expected result~%")
Expand Down
20 changes: 20 additions & 0 deletions contrib/eus64-check/test_foreign.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,23 @@ double call_ffunc() {
2080.0, 2090.0,
206, 207);
}

long get_size_of_pointer() {
return (sizeof(void *));
}

long get_size_of_float32() {
return (sizeof(float));
}

long get_size_of_double() {
return (sizeof(double));
}

long get_size_of_long() {
return (sizeof(long));
}

long get_size_of_int() {
return (sizeof(int));
}

0 comments on commit 0dfb09e

Please sign in to comment.