diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-09-23 17:04:31 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-09-26 20:01:32 +0100 |
| commit | 537aefec06307139899e3f2f2cd74842a3af6345 (patch) | |
| tree | 3af4c0729cf61225b4d4da10109a8eda497b83d3 /src/test/java | |
| parent | ac51f8470a58caeb611a4c55bb19c1c2281c4960 (diff) | |
Generate code for zero-element tuple without alloc
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java index b95ca4fb..e489fb37 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java +++ b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java @@ -26,4 +26,14 @@ public class PatioCodeGenTupleCreateTests { snapshotter.assertSnapshot(serialize(result)); } + + @Test + public void zeroElementTupleIsCreatedWithoutAlloc(Snapshotter snapshotter) throws IOException { + var stackIr = Instructions.tupleCreate(0); + var context = PatioCodeGenContext.EMPTY; + + var result = PatioCodeGen.generateInstruction(stackIr, context); + + snapshotter.assertSnapshot(serialize(result)); + } } |
