1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // Multi-Phasic Applications: SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.c
;
12 import net
.multiphasicapps
.tac
.TestRunnable
;
15 * Tests function splicing.
19 public class TestFunctionSplice
30 try (__Spool__ spool
= __Spool__
.__init(false))
33 try (CFunctionBlock outer
= spool
.define(CFunctionType
.of(
34 "test", CPrimitiveType
.VOID
)))
36 // Setup splice and write into each sub-block
37 try (CFunctionBlockSplices splices
= outer
.splice(3))
39 try (CFunctionBlock block
= splices
.splice(2))
42 CVariable
.of(CPrimitiveType
.SIGNED_SHORT
,
46 try (CFunctionBlock block
= splices
.splice(1))
49 CVariable
.of(CPrimitiveType
.SIGNED_INTEGER
,
53 try (CFunctionBlock block
= splices
.splice(0))
56 CVariable
.of(CPrimitiveType
.SIGNED_LONG
,
62 this.secondary("spliced", spool
.tokens());