diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-07-19 21:14:06 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-07-19 21:14:06 +0100 |
| commit | 61f34251a1a6418caead1910366d0d26c9408902 (patch) | |
| tree | 6ebd07c6eedcec5d5172ded6016160d5d088c668 /src/test/java | |
| parent | b2a6c26840529ca98b061526e88fbfcd7266983e (diff) | |
Add Patio code gen for local-load
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java new file mode 100644 index 00000000..e379722f --- /dev/null +++ b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java @@ -0,0 +1,23 @@ +package org.shedlang.compiler.patio; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.shedlang.compiler.stackir.instructions.Instructions; +import org.shedlang.compiler.testing.snapshots.SnapshotResolver; +import org.shedlang.compiler.testing.snapshots.Snapshotter; + +import java.io.IOException; + +import static org.shedlang.compiler.patio.PatioTesting.serialize; + +@ExtendWith({SnapshotResolver.class}) +public class PatioCodeGenLocalLoadTests { + @Test + public void localLoadGeneratesLocalLoad(Snapshotter snapshotter) throws IOException { + var stackIr = Instructions.localLoad("x"); + + var result = PatioCodeGen.generateInstruction(stackIr); + + snapshotter.assertSnapshot(serialize(result)); + } +} |
