Skip to content

Commit

Permalink
fix: Fix asm block debug func
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed Dec 7, 2024
1 parent be139c6 commit 1ec9efa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion parser/asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void asm_debug(int depth, parser_node *node)
while (curr)
{
printtabs(depth + 1);
printf("\"%s\"", (char *)curr->value);
printf("\"%s\"\n", (char *)curr->value);
curr = curr->next;
}
}
Expand Down
24 changes: 21 additions & 3 deletions tests/output/inp_vararg.c_tree_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ Program(
TKN_CHAR
Statements:
Asm:
"mov r9, r8" "mov r8, rcx" "mov rcx, rdx" "mov rdx, rsi" "mov rsi, rdi" "mov rdi, 0" Asm:
"push rdi" "push rsi" "push rdx" "push rcx" "push r8" "push r9" VarDecl(ret):
"mov r9, r8"
"mov r8, rcx"
"mov rcx, rdx"
"mov rdx, rsi"
"mov rsi, rdi"
"mov rdi, 0"
Asm:
"push rdi"
"push rsi"
"push rdx"
"push rcx"
"push r8"
"push r9"
VarDecl(ret):
Type(Name: ret):
Pointer of:
TKN_CHAR
Expand All @@ -66,7 +78,13 @@ Program(
Pointer of:
TKN_CHAR
Asm:
"pop r9" "pop r8" "pop rcx" "pop rdx" "pop rsi" "pop rdi" FunctionCall:
"pop r9"
"pop r8"
"pop rcx"
"pop rdx"
"pop rsi"
"pop rdi"
FunctionCall:
Function:
Variable(sprintf)
Args:
Expand Down

0 comments on commit 1ec9efa

Please sign in to comment.