diff a/test/jdk/jdk/incubator/code/bytecode/TestSlots.java b/test/jdk/jdk/incubator/code/bytecode/TestSlots.java
--- /dev/null
+++ b/test/jdk/jdk/incubator/code/bytecode/TestSlots.java
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ */
+
+import jdk.incubator.code.Reflect;
+import jdk.incubator.code.Op;
+import jdk.incubator.code.bytecode.BytecodeGenerator;
+import jdk.incubator.code.dialect.core.CoreOp;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+import java.util.Optional;
+import java.util.stream.Stream;
+
+/*
+ * @test
+ * @modules jdk.incubator.code
+ * @library ../
+ * @run junit TestSlots
+ * @run main Unreflect TestSlots
+ * @run junit TestSlots
+ */
+
+public class TestSlots {
+    @Reflect
+    static double f(double i, double j) {
+        i = i + j;
+
+        double k = 4.0;
+        k += i;
+        return k;
+    }
+
+    @Test
+    public void testF() throws Throwable {
+        CoreOp.FuncOp f = getFuncOp("f");
+
+        MethodHandle mh = generate(f);
+
+        Assertions.assertEquals((double) mh.invoke(1.0d, 2.0d), f(1.0d, 2.0d));
+    }
+
+    @Reflect
+    static double f2(double x, double y) {
+        return x * (-Math.sin(x * y) + y) * 4.0d;
+    }
+
+    @Test
+    public void testF2() throws Throwable {
+        CoreOp.FuncOp f = getFuncOp("f2");
+
+        MethodHandle mh = generate(f);
+
+        Assertions.assertEquals((double) mh.invoke(1.0d, 2.0d), f2(1.0d, 2.0d));
+    }
+
+    @Reflect
+    static double f3(/* independent */ double x, int y) {
+        /* dependent */
+        double o = 1.0;
+        for (int i = 0; i < y; i = i + 1) {
+            if (i > 1) {
+                if (i < 5) {
+                    o = o * x;
+                }
+            }
+        }
+        return o;
+    }
+
+    @Test
+    public void testF3() throws Throwable {
+        CoreOp.FuncOp f = getFuncOp("f3");
+
+        MethodHandle mh = generate(f);
+
+        for (int i = 0; i < 7; i++) {
+            Assertions.assertEquals((double) mh.invoke(2.0d, i), f3(2.0d, i));
+        }
+    }
+
+    @Reflect
+    static int f4(/* Unused */ int a, int b) {
+        return b;
+    }
+
+    @Test
+    public void testF4() throws Throwable {
+        CoreOp.FuncOp f = getFuncOp("f4");
+
+        MethodHandle mh;
+        try {
+            mh = generate(f);
+        } catch (VerifyError e) {
+            Assertions.fail("invalid class file generated", e);
+            return;
+        }
+
+        Assertions.assertEquals((int) mh.invoke(1, 2), f4(1, 2));
+    }
+
+    @Reflect
+    static double f5(/* Unused */ double a, double b) {
+        return b;
+    }
+
+    @Test
+    public void testF5() throws Throwable {
+        CoreOp.FuncOp f = getFuncOp("f5");
+
+        MethodHandle mh;
+        try {
+            mh = generate(f);
+        } catch (VerifyError e) {
+            Assertions.fail("invalid class file generated", e);
+            return;
+        }
+
+        Assertions.assertEquals((double) mh.invoke(1.0, 2.0), f5(1.0, 2.0));
+    }
+
+    static MethodHandle generate(CoreOp.FuncOp f) {
+        System.out.println(f.toText());
+
+        return BytecodeGenerator.generate(MethodHandles.lookup(), f);
+    }
+
+    static CoreOp.FuncOp getFuncOp(String name) {
+        Optional<Method> om = Stream.of(TestSlots.class.getDeclaredMethods())
+                .filter(m -> m.getName().equals(name))
+                .findFirst();
+
+        Method m = om.get();
+        return Op.ofMethod(m).get();
+    }
+
+}
