aboutsummaryrefslogtreecommitdiff
path: root/tests/sema_test.c
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-08 11:26:42 +0200
committerhachem <im@hachem.wtf>2026-09-08 11:26:42 +0200
commit21be45a904a0afc767214298721bd2bbce19a054 (patch)
tree4e97ae690457f82cbedd30bb8f7cf67898e578a5 /tests/sema_test.c
parent8d73e3f2cdba9ce3591bab5c02e5d90ce62a8de3 (diff)
feat: add signed memory loads
Diffstat (limited to 'tests/sema_test.c')
-rw-r--r--tests/sema_test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/sema_test.c b/tests/sema_test.c
index dc01d47..643ffdf 100644
--- a/tests/sema_test.c
+++ b/tests/sema_test.c
@@ -97,6 +97,13 @@ static void test_deref_needs_register(struct TestContext* context)
check(context, analyze_source("proc main\n{\nrax = ^rsi\n}\n"));
}
+static void test_signed_load_needs_size(struct TestContext* context)
+{
+ check(context, analyze_source("proc main\n{\nrax = ^signed byte rsi\n}\n"));
+ check(context, !analyze_source("proc main\n{\nrax = ^signed rsi\n}\n"));
+ check(context, !analyze_source("proc main\n{\nrax = ^signed qword rsi\n}\n"));
+}
+
static void test_stack_size_constant(struct TestContext* context)
{
check(context, analyze_source(
@@ -152,6 +159,7 @@ void run_sema_tests(struct TestContext* context)
test_const_expr_rejects_register(context);
test_const_expr_rejects_data(context);
test_deref_needs_register(context);
+ test_signed_load_needs_size(context);
test_stack_size_constant(context);
test_enum_struct_members(context);
test_references_resolve(context);