diff options
| author | Cliff Click <cliffc@acm.org> | 2026-08-10 11:11:18 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-11-08 14:10:02 -0800 |
| commit | 44505aa5b75b1046f13f2bc2a52fe0b16d975838 (patch) | |
| tree | cc558485c807ac3842cd73943cf5e294c4a307de /src/test/java/com/seaofnodes/simple/EscapeFlowTest.java | |
| parent | 2560096fb4636263798ae56c88687973c72cdf6e (diff) | |
| download | Simple-linear-chapter30.tar.gz Simple-linear-chapter30.zip | |
Chapter 30: Text Formatting and Diagnosticslinear-chapter30
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 <jun784@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/EscapeFlowTest.java')
| -rw-r--r-- | src/test/java/com/seaofnodes/simple/EscapeFlowTest.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/java/com/seaofnodes/simple/EscapeFlowTest.java b/src/test/java/com/seaofnodes/simple/EscapeFlowTest.java index 71a281b5..5a20388b 100644 --- a/src/test/java/com/seaofnodes/simple/EscapeFlowTest.java +++ b/src/test/java/com/seaofnodes/simple/EscapeFlowTest.java @@ -28,7 +28,7 @@ public class EscapeFlowTest { // Start memory rather than a frozen declaration constant. @Test public void testUnknownCallerCallback() { CodeGen code = new CodeGen(""" - val _hidden_noInline = { int n -> return n+2; }; + val _hidden_noInline = { int n -> int result=n+2; return result; }; val apply_noInline = { {int->int} f,int n -> return f(n); }; return apply_noInline; """).parse(); @@ -42,16 +42,16 @@ public class EscapeFlowTest { assertTrue(callback.in(1) instanceof ProjNode); TypeFunPtr type = (TypeFunPtr)callback._type; assertTrue(XInt.isHigh(type.fidxs())); - assertSame(TypeInteger.BOT,apply.ret().expr()._type); + assertSame(TypeInteger.I32,apply.ret().expr()._type); // Only <clinit> and apply escape; forwarding #self must not expose _hidden. assertEquals("Stop[ return { apply_noInline}; return #2; ]",code.print()); } @Test public void testNativeCallbackRoundTrip() { CodeGen code = new CodeGen(""" - val _callback_noInline = { int n -> return n+1; }; + val _callback_noInline = { int n -> int result=n+1; return result; }; { {int->int} -> {int->int} } bounce = "C"; - return bounce(_callback_noInline)(arg); + return bounce(_callback_noInline)(((arg<<32)>>32)); """).driver(CodeGen.Phase.TypeCheck); FunNode callback = named(code,"_callback_noInline"); assertTrue(callback.unknownCallers()); @@ -87,7 +87,7 @@ public class EscapeFlowTest { @Test public void testPublicAllocator() { CodeGen code = new CodeGen(""" struct Box { int n; new Box = { int x -> n=x; }; }; - return new Box(arg).n; + return new Box(((arg<<32)>>32)).n; """).parse(); FunNode allocator = named(code,"Test.Box.<new>"); int[] helpers = XInt.EMPTY; |
