From 61f34251a1a6418caead1910366d0d26c9408902 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 19 Jul 2023 21:14:06 +0100 Subject: Add Patio code gen for local-load --- .../compiler/patio/PatioCodeGenLocalLoadTests.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java (limited to 'src/test/java') 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)); + } +} -- cgit v1.2.3