summaryrefslogtreecommitdiff
path: root/c/wasmtime-basic/test.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/wasmtime-basic/test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/c/wasmtime-basic/test.c b/c/wasmtime-basic/test.c
new file mode 100644
index 0000000..f6e8723
--- /dev/null
+++ b/c/wasmtime-basic/test.c
@@ -0,0 +1,26 @@
+/*
+ * test.c
+ */
+
+#include <stdint.h>
+
+typedef uint32_t u32;
+typedef uint8_t u8;
+
+__attribute__((import_module("env"), import_name("imported_func")))
+void imported_func(void);
+
+__attribute__((export_name("exported_func")))
+int exported_func(u8 *addr, u32 mem_size)
+{
+ (void)addr;
+ (void)mem_size;
+ imported_func();
+
+ return 0;
+}
+
+int main(void)
+{
+ return 0;
+}