diff a/test/jdk/jdk/incubator/code/TestTransitiveInvokeModule.java b/test/jdk/jdk/incubator/code/TestTransitiveInvokeModule.java
--- /dev/null
+++ b/test/jdk/jdk/incubator/code/TestTransitiveInvokeModule.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @modules jdk.incubator.code
+ * @run junit TestTransitiveInvokeModule
+ * @run junit/othervm -Dbabylon.ssa=cytron TestTransitiveInvokeModule
+ */
+
+import jdk.incubator.code.Reflect;
+import jdk.incubator.code.CodeTransformer;
+import jdk.incubator.code.Op;
+import jdk.incubator.code.dialect.core.SSA;
+import jdk.incubator.code.dialect.core.CoreOp;
+import jdk.incubator.code.dialect.java.JavaOp;
+import jdk.incubator.code.dialect.java.MethodRef;
+import jdk.incubator.code.interpreter.Interpreter;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.stream.Stream;
+
+public class TestTransitiveInvokeModule {
+
+    @Reflect
+    static int m(int i, List<Integer> l) {
+        if (i < 0) {
+            return i;
+        }
+
+        return n(i - 1, l);
+    }
+
+    @Reflect
+    static int n(int i, List<Integer> l) {
+        l.add(i);
+        return m(i - 1, l);
+    }
+
+    @Test
+    public void test() {
+        Optional<Method> om = Stream.of(TestTransitiveInvokeModule.class.getDeclaredMethods())
+                .filter(m -> m.getName().equals("m"))
+                .findFirst();
+
+        CoreOp.ModuleOp module = createTransitiveInvokeModule(MethodHandles.lookup(), om.get());
+        System.out.println(module.toText());
+        module = module.transform(CodeTransformer.LOWERING_TRANSFORMER);
+        System.out.println(module.toText());
+        module = SSA.transform(module);
+        System.out.println(module.toText());
+
+        module.functionTable().forEach((s, funcOp) -> {
+            System.out.println(s + " -> " + funcOp);
+        });
+
+        List<Integer> r = new ArrayList<>();
+        Object result = Interpreter.invoke(MethodHandles.lookup(), module.functionTable().firstEntry().getValue(), 10, r);
+        Assertions.assertEquals(List.of(9, 7, 5, 3, 1, -1), r);
+        Assertions.assertEquals(-2, result);
+    }
+
+    static CoreOp.ModuleOp createTransitiveInvokeModule(MethodHandles.Lookup l,
+                                                        Method m) {
+        Optional<CoreOp.FuncOp> codeModel = Op.ofMethod(m);
+        if (codeModel.isPresent()) {
+            return createTransitiveInvokeModule(l, MethodRef.method(m), codeModel.get());
+        } else {
+            return CoreOp.module(List.of());
+        }
+    }
+
+    static CoreOp.ModuleOp createTransitiveInvokeModule(MethodHandles.Lookup l,
+                                                        MethodRef entryRef, CoreOp.FuncOp entry) {
+        LinkedHashSet<MethodRef> funcsVisited = new LinkedHashSet<>();
+        List<CoreOp.FuncOp> funcs = new ArrayList<>();
+
+        record RefAndFunc(MethodRef r, CoreOp.FuncOp f) {
+        }
+        Deque<RefAndFunc> work = new ArrayDeque<>();
+        work.push(new RefAndFunc(entryRef, entry));
+        while (!work.isEmpty()) {
+            RefAndFunc rf = work.pop();
+            if (!funcsVisited.add(rf.r)) {
+                continue;
+            }
+
+            CoreOp.FuncOp tf = rf.f.transform(rf.r.toString(), (block, op) -> {
+                if (op instanceof JavaOp.InvokeOp iop) {
+                    MethodRef r = iop.invokeReference();
+                    Method em = null;
+                    try {
+                        em = r.resolveToMethod(l);
+                    } catch (ReflectiveOperationException _) {
+                    }
+                    if (em instanceof Method m) {
+                        Optional<CoreOp.FuncOp> f = Op.ofMethod(m);
+                        if (f.isPresent()) {
+                            RefAndFunc call = new RefAndFunc(r, f.get());
+                            // Place model on work queue
+                            work.push(call);
+
+                            // Replace invocation with function call
+                            Op.Result result = block.op(CoreOp.funcCall(
+                                    call.r.toString(),
+                                    call.f.invokableType(),
+                                    block.context().getValues(iop.operands())));
+                            // Map invocation result to function call result
+                            block.context().mapValue(op.result(), result);
+                            return block;
+                        }
+                    }
+                }
+                block.op(op);
+                return block;
+            });
+            funcs.add(tf);
+        }
+
+        return CoreOp.module(funcs);
+    }
+}
