From 65aedb5a4992263c3294a62c4089af99b1cf0c80 Mon Sep 17 00:00:00 2001 From: Andre Wagner Date: Sun, 10 May 2026 13:08:29 -0500 Subject: [PATCH] . --- Makefile | 4 ++-- lib/value.c | 6 +++--- lib/vm.c | 1 + src/tests.c | 3 --- src/tests.yaml | 6 ++++++ test/tests.cc | 7 +++++++ 6 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 src/tests.c create mode 100644 src/tests.yaml create mode 100644 test/tests.cc diff --git a/Makefile b/Makefile index 5a625cf..8588edc 100644 --- a/Makefile +++ b/Makefile @@ -83,8 +83,8 @@ tyche: src/tyche.o libtyche.a tyche-test: CFLAGS += ${DEBUG_CFLAGS} tyche-test: LDFLAGS += ${DEBUG_LDFLAGS} -tyche-test: src/tests.o libtyche.a - $(CC) -o $@ $^ ${LDFLAGS} +tyche-test: test/tests.o + $(CC) -o $@ $^ ${LDFLAGS} -I../lib libtyche.a: lib/vm.o ar rcs $@ $^ diff --git a/lib/value.c b/lib/value.c index 3a1e178..c308fd7 100644 --- a/lib/value.c +++ b/lib/value.c @@ -42,17 +42,17 @@ static uint32_t value_idx(VALUE v) return v.idx; } -VALUE create_value_integer(int32_t v) +static VALUE create_value_integer(int32_t v) { return (VALUE) { .type = TT_INTEGER, .i = v }; } -VALUE create_value_real(float f) +static VALUE create_value_real(float f) { return (VALUE) { .type = TT_INTEGER, .f = f }; } -VALUE create_value_idx(TYC_TYPE type, uint32_t idx) +static VALUE create_value_idx(TYC_TYPE type, uint32_t idx) { #ifdef CHECK_TYCHE_BUGS if (type != TT_FUNCTION && type != TT_NATIVE_PTR && type != TT_ARRAY && type != TT_TABLE && type != TT_STRING && type != TT_STRING_CONST) diff --git a/lib/vm.c b/lib/vm.c index e69de29..857af2b 100644 --- a/lib/vm.c +++ b/lib/vm.c @@ -0,0 +1 @@ +#include "stack.c" \ No newline at end of file diff --git a/src/tests.c b/src/tests.c deleted file mode 100644 index 0eefc1c..0000000 --- a/src/tests.c +++ /dev/null @@ -1,3 +0,0 @@ -int main() -{ -} \ No newline at end of file diff --git a/src/tests.yaml b/src/tests.yaml new file mode 100644 index 0000000..c27bebd --- /dev/null +++ b/src/tests.yaml @@ -0,0 +1,6 @@ +- name: Basic test + assembly: | + .func 0 + pushi 2 + ret + expected: 2 \ No newline at end of file diff --git a/test/tests.cc b/test/tests.cc new file mode 100644 index 0000000..17810de --- /dev/null +++ b/test/tests.cc @@ -0,0 +1,7 @@ +extern "C" { +#include "../lib/vm.c" +} + +int main() +{ +} \ No newline at end of file