diff --git a/tests/native_test.c b/tests/native_test.c new file mode 100644 index 0000000..d8126e4 --- /dev/null +++ b/tests/native_test.c @@ -0,0 +1,14 @@ +#include +#include + +// Build with +// cc -shared -fPIC native_test.c -o native_test.so +// or +// cc -shared -fPIC native_test.c -o native_test.dll + +int labashka(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void), size_t max_size ) { + printf("At %zu, there's %d.\n", len(), pop()); + push(12); + printf("Maximum size is %zu.\n", max_size); + return 0; +} diff --git a/tests/native_test.lb b/tests/native_test.lb new file mode 100644 index 0000000..2a42825 --- /dev/null +++ b/tests/native_test.lb @@ -0,0 +1,3 @@ +@ 0 + push -1 + #native native_test