diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-08-27 22:07:14 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-08-27 22:07:14 +0100 |
| commit | f914488506c83ae98ee699d88501d7df756dbae5 (patch) | |
| tree | dff208a90456c77fece89e653072bc870459ce75 /src/test/java | |
| parent | d408f4f80670ed7f73d09f8ccfefdcb8a7835406 (diff) | |
Fix generation of if instruction for while loop
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/stackir/StackCompilerWhileTests.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/test/java/org/shedlang/compiler/stackir/StackCompilerWhileTests.java b/src/test/java/org/shedlang/compiler/stackir/StackCompilerWhileTests.java index c8fd1cdc..398a9827 100644 --- a/src/test/java/org/shedlang/compiler/stackir/StackCompilerWhileTests.java +++ b/src/test/java/org/shedlang/compiler/stackir/StackCompilerWhileTests.java @@ -28,11 +28,15 @@ public class StackCompilerWhileTests { isSequence( isLocalLoadInstruction("c__0"), isIfInstruction( - isSequence(), isSequence( - isLoopBreakInstruction() + isPushUnitInstruction() + ), + isSequence( + isLoopBreakInstruction(), + isPushUnitInstruction() ) ), + isDiscardInstruction(), isPushIntInstruction(42), isDiscardInstruction(), isLoopContinueInstruction() @@ -61,11 +65,15 @@ public class StackCompilerWhileTests { isSequence( isLocalLoadInstruction("c__0"), isIfInstruction( - isSequence(), isSequence( - isLoopBreakInstruction() + isPushUnitInstruction() + ), + isSequence( + isLoopBreakInstruction(), + isPushUnitInstruction() ) ), + isDiscardInstruction(), isPushIntInstruction(42), isDiscardInstruction(), isLoopContinueInstruction() |
