diff --git a/tests/ComputeSharp.Tests/StaticFunctionsTests.cs b/tests/ComputeSharp.Tests/StaticFunctionsTests.cs index d1d9a515..fbcd1c53 100644 --- a/tests/ComputeSharp.Tests/StaticFunctionsTests.cs +++ b/tests/ComputeSharp.Tests/StaticFunctionsTests.cs @@ -121,5 +121,19 @@ namespace ComputeSharp.Tests Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); } + + [TestMethod] + public void StatelessLocalFunction() + { + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); + + float f(float x) => x * x; + + Gpu.Default.For(1, id => buffer[0] = f(3)); + + float[] result = buffer.GetData(); + + Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); + } } }