.
This commit is contained in:
4
Makefile
4
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 $@ $^
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
int main()
|
||||
{
|
||||
}
|
||||
6
src/tests.yaml
Normal file
6
src/tests.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
- name: Basic test
|
||||
assembly: |
|
||||
.func 0
|
||||
pushi 2
|
||||
ret
|
||||
expected: 2
|
||||
7
test/tests.cc
Normal file
7
test/tests.cc
Normal file
@@ -0,0 +1,7 @@
|
||||
extern "C" {
|
||||
#include "../lib/vm.c"
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user