Skip to content

Commit

Permalink
issue #21 #22 New test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jun 6, 2020
1 parent 6b27a0a commit 4eadd9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/linearizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,9 @@ static void output_pseudo(struct pseudo *pseudo, membuff_t *mb)
break;
}
case SYM_UPVALUE: {
raviX_buffer_add_fstring(mb, "Upval(%u)", pseudo->regnum);
raviX_buffer_add_fstring(mb, "Upval(%u, Proc%%%d, %s)", pseudo->regnum,
pseudo->symbol->upvalue.target_variable->variable.block->function->function_expr.proc_id,
pseudo->symbol->upvalue.target_variable->variable.var_name->str);
break;
}
case SYM_GLOBAL: {
Expand Down
10 changes: 5 additions & 5 deletions tests/expected/results.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2645,7 +2645,7 @@ L0 (entry)
L1 (exit)
define Proc%4
L0 (entry)
RET {Upval(0)} {L1}
RET {Upval(0, Proc%2, a)} {L1}
L1 (exit)
return @integer 1
function()
Expand Down Expand Up @@ -6081,7 +6081,7 @@ L0 (entry)
L1 (exit)
define Proc%4
L0 (entry)
RET {Upval(0)} {L1}
RET {Upval(0, Proc%2, a)} {L1}
L1 (exit)
define Proc%5
L0 (entry)
Expand All @@ -6090,7 +6090,7 @@ L0 (entry)
L1 (exit)
define Proc%6
L0 (entry)
RET {Upval(0)} {L1}
RET {Upval(0, Proc%2, a)} {L1}
L1 (exit)
return function (a, b, c, d, e)
if a == b then goto l1
Expand Down Expand Up @@ -9232,13 +9232,13 @@ L2
L3
LOADGLOBAL {print} {T(2)}
CALL {T(2), local(m, 0)} {T(2..)}
LEN {Upval(0)} {T(3)}
LEN {Upval(0, Proc%1, msgs)} {T(3)}
ADD {T(3), 1 Kint(0)} {T(4)}
LOADGLOBAL {string} {T(5)}
GETsk {T(5), 'sub' Ks(1)} {T(6)}
UNMi {3 Kint(2)} {Tint(0)}
CALL {T(6), local(m, 0), 3 Kint(2), Tint(0)} {T(6..)}
PUT {Upval(0), T(4), T(6[6..])}
PUT {Upval(0, Proc%1, msgs), T(4), T(6[6..])}
BR {L4}
L4
BR {L1}
Expand Down
2 changes: 1 addition & 1 deletion tests/input/t05_upvals.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function f()
a = a + 1
return a
end
end
end, a
end
#
return function()
Expand Down

0 comments on commit 4eadd9d

Please sign in to comment.