diff options
Diffstat (limited to 'testes/code.lua')
-rw-r--r-- | testes/code.lua | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/testes/code.lua b/testes/code.lua index ad484485..9b3f2b68 100644 --- a/testes/code.lua +++ b/testes/code.lua | |||
@@ -297,7 +297,7 @@ check(function () | |||
297 | b[a], a = c, b | 297 | b[a], a = c, b |
298 | a, b = c, a | 298 | a, b = c, a |
299 | a = a | 299 | a = a |
300 | end, | 300 | end, |
301 | 'LOADNIL', | 301 | 'LOADNIL', |
302 | 'MOVE', 'MOVE', 'SETTABLE', | 302 | 'MOVE', 'MOVE', 'SETTABLE', |
303 | 'MOVE', 'MOVE', 'MOVE', 'SETTABLE', | 303 | 'MOVE', 'MOVE', 'MOVE', 'SETTABLE', |
@@ -329,18 +329,13 @@ checkequal(function (l) local a; return 0 <= a and a <= l end, | |||
329 | function (l) local a; return not (not(a >= 0) or not(a <= l)) end) | 329 | function (l) local a; return not (not(a >= 0) or not(a <= l)) end) |
330 | 330 | ||
331 | 331 | ||
332 | -- if-goto optimizations | 332 | -- if-break optimizations |
333 | check(function (a, b, c, d, e) | 333 | check(function (a, b) |
334 | if a == b then goto l1; | 334 | while a do |
335 | elseif a == c then goto l2; | 335 | if b then break else a = a + 1 end |
336 | elseif a == d then goto l2; | ||
337 | else if a == e then goto l3; | ||
338 | else goto l3 | ||
339 | end | ||
340 | end | 336 | end |
341 | ::l1:: ::l2:: ::l3:: ::l4:: | 337 | end, |
342 | end, 'EQ', 'JMP', 'EQ', 'JMP', 'EQ', 'JMP', 'EQ', 'JMP', 'JMP', | 338 | 'TEST', 'JMP', 'TEST', 'JMP', 'ADDI', 'JMP', 'RETURN0') |
343 | 'CLOSE', 'CLOSE', 'CLOSE', 'CLOSE', 'RETURN0') | ||
344 | 339 | ||
345 | checkequal( | 340 | checkequal( |
346 | function (a) while a < 10 do a = a + 1 end end, | 341 | function (a) while a < 10 do a = a + 1 end end, |