Add test for #native

This commit is contained in:
bʰedoh₂ swé 2024-06-17 04:07:42 +05:00
parent ba325f15a1
commit e8c5109fb0
2 changed files with 17 additions and 0 deletions

14
tests/native_test.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdlib.h>
#include <stdio.h>
// 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;
}

3
tests/native_test.lb Normal file
View File

@ -0,0 +1,3 @@
@ 0
push -1
#native native_test