2
;;; inline function test
7
(test-start "c-wrapper (inline)")
10
(c-load-library "libc")
11
(c-load-library "./ffitest")
12
(c-include '("stdio.h" "stdlib.h" "./ffitest.h"))
22
(x->string (return_string))))
27
(let ((a (make (c-array <c-int> 3))))
33
(test "func call without argument"
37
(list (ref test_array 0)
43
(test "func call with arguments"
48
(test "ref struct (. operator)"
53
(test "ref struct (-> operator)"
56
(let ((a (make (c-struct 'test_sint))))
57
(set! (ref a 'value) 1)
58
(ref_struct2 (ptr a)))))
61
(test "post increment"
66
(test "post decrement"
91
(test "unary logical negation"
94
(list (unary_logneg 1) (unary_logneg 0))))
96
(test "unary bitwise negation"
101
(test "unary reference"
106
(test "unary dereference"
109
(ref (deref (unary_deref)))))
114
(eq? (c-sizeof <c-int>) (op_sizeof))))
154
(list (op_lt 1 2) (op_lt 2 2) (op_lt 2 1))))
159
(list (op_gt 1 2) (op_gt 2 2) (op_gt 2 1))))
161
(test "lesser than or equal"
164
(list (op_lteq 1 2) (op_lteq 2 2) (op_lteq 2 1))))
166
(test "greater than or equal"
169
(list (op_gteq 1 2) (op_gteq 2 2) (op_gteq 2 1))))
174
(list (op_eq 1 2) (op_eq 2 2) (op_eq 2 1))))
179
(list (op_noteq 1 2) (op_noteq 2 2) (op_noteq 2 1))))
199
(list (op_logand 1 1 1)
207
(list (op_logor 1 1 1)
237
(test "assign left shift"
240
(assign_left_shift 1 2)))
242
(test "assign right shift"
245
(assign_right_shift 8 2)))
247
(test "assign bitwise and"
250
(assign_bitand 11 5)))
252
(test "assign bitwise or"
255
(assign_bitor 11 5)))
257
(test "assign bitwise xor"
260
(assign_bitxor 11 5)))
277
(test "while continue"
280
(test_while_continue)))
287
(test "do while break"
290
(test_dowhile_break)))
292
(test "do while continue"
295
(test_dowhile_continue)))
302
(test "for noinit, notest, noupdate"
305
(test_for_noinit_notest_noupdate)))
307
(test "for noinit, notest"
310
(test_for_noinit_notest)))
312
(test "for noinit, noupdate"
315
(test_for_noinit_noupdate)))
320
(test_for_noinit_noupdate)))
322
(test "for notest, noupdate"
325
(test_for_notest_noupdate)))
335
(test_for_noupdate)))
340
(eq? (offset_calc) (c-offsetof (c-struct 'test_uchar) 'value))))
342
(test "not_supported"
345
(procedure? not_supported)))