Add register parameter to AM stack operations

This commit is contained in:
2025-08-10 20:38:04 +01:00
parent 57c39fd00b
commit 76efcef953
5 changed files with 29 additions and 19 deletions

View File

@@ -20,13 +20,25 @@ static void test_expr_value_restored_after_push_modify_pop(void)
expr_t a, b;
am.regs[EXPR] = &a;
am_push(&am);
am_push(&am, EXPR);
am.regs[EXPR] = &b;
am_pop(&am);
am_pop(&am, EXPR);
TEST_ASSERT_EQUAL(&a, am.regs[EXPR]);
}
static void test_argl_value_restored_after_push_modify_pop(void)
{
expr_t a, b;
am.regs[ARGL] = &a;
am_push(&am, ARGL);
am.regs[ARGL] = &b;
am_pop(&am, ARGL);
TEST_ASSERT_EQUAL(&a, am.regs[ARGL]);
}
static void test_append_arg_42_with_empty_argl(void)
{
am.regs[ARGL] = expr_empty_list(&am);
@@ -48,6 +60,7 @@ int main(void)
{
UNITY_BEGIN();
RUN_TEST(test_expr_value_restored_after_push_modify_pop);
RUN_TEST(test_argl_value_restored_after_push_modify_pop);
RUN_TEST(test_append_arg_42_with_empty_argl);
return UNITY_END();
}