diff options
| author | Damien George <damien@micropython.org> | 2021-06-05 22:28:05 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-06-06 22:52:25 +1000 |
| commit | 20a8f4f7ec2f691e2381a150ac6e246df9c58077 (patch) | |
| tree | f0c4da468b0ad8158c18df8837e079f05be20085 /tests/unix/ffi_lib.c | |
| parent | 784208543448e8022b185a82015e107f04960738 (diff) | |
tests/unix: Add ffi test for integer types.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/unix/ffi_lib.c')
| -rw-r--r-- | tests/unix/ffi_lib.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/unix/ffi_lib.c b/tests/unix/ffi_lib.c new file mode 100644 index 000000000..35340536a --- /dev/null +++ b/tests/unix/ffi_lib.c @@ -0,0 +1,33 @@ +#include <stdint.h> + +int8_t f8i(int8_t x) { + return x ^ 1; +} + +uint8_t f8u(uint8_t x) { + return x ^ 1; +} + +int16_t f16i(int16_t x) { + return x ^ 1; +} + +uint16_t f16u(uint16_t x) { + return x ^ 1; +} + +int32_t f32i(int32_t x) { + return x ^ 1; +} + +uint32_t f32u(uint32_t x) { + return x ^ 1; +} + +int64_t f64i(int64_t x) { + return x ^ 1; +} + +uint64_t f64u(uint64_t x) { + return x ^ 1; +} |
