From 89dd0a79da85b2c7102b7c8918a1466e6238fe94 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 13 Jun 2025 15:42:08 -0700 Subject: Chapter 24a: SCCP Within a Function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki Co-authored-by: Hadházy Tamás Co-authored-by: Claude Opus 5 --- src/test/java/com/seaofnodes/simple/TestC.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test/java/com/seaofnodes/simple/TestC.java') diff --git a/src/test/java/com/seaofnodes/simple/TestC.java b/src/test/java/com/seaofnodes/simple/TestC.java index 2e61211a..3b3aabc0 100644 --- a/src/test/java/com/seaofnodes/simple/TestC.java +++ b/src/test/java/com/seaofnodes/simple/TestC.java @@ -41,14 +41,31 @@ public abstract class TestC { String src = Files.readString(Path.of(sfile)); run(src,CALL_CONVENTION,arg, "",standalone? null: cfile,efile,"S",expected,spills); } + + // link with c and also inline + public static void run(String src, String file, TypeInteger arg, String expected, int spills) throws IOException { + String dir = "src/test/java/com/seaofnodes/simple/progs"; + String cfile = dir+"/"+file+".c"; + String efile = "build/objs/"+file; + run(src, CALL_CONVENTION, arg, "", cfile, efile, "S", expected, spills); + } + public static void run(String dir, String file, String expected, int spills ) throws IOException { run(dir, file,null, expected, spills, false); } + // Do not link with c file - no inline. public static void runS(String file, String expected, int spills ) throws IOException { run("src/test/java/com/seaofnodes/simple/progs", file, null, expected, spills, true); } + + // Do not link with c file - just inline with source. + public static void runSF(String name, String src, TypeInteger arg, String expected, int spills ) throws IOException { + String efile = "build/objs/"+name; + run(src,CALL_CONVENTION,arg, "",null,efile,"S",expected,spills); + } + public static void runS(String file, TypeInteger arg, String expected, int spills ) throws IOException { run("src/test/java/com/seaofnodes/simple/progs", file, arg, expected, spills, true); } -- cgit v1.2.3