+#if NET_2_0
+ delegate void FooFoo ();
+
+ static void Foo ()
+ {
+ }
+
+ [Test]
+ public void TestEmitCalliWithNullReturnType ()
+ {
+ MethodBuilder mb = tb.DefineMethod ("F",
+ MethodAttributes.Public | MethodAttributes.Static, null, new Type [] { typeof (IntPtr) });
+ mb.SetImplementationFlags (MethodImplAttributes.NoInlining);
+ il_gen = mb.GetILGenerator ();
+ il_gen.Emit (OpCodes.Ldarg_0);
+ il_gen.EmitCalli (OpCodes.Calli, CallingConvention.StdCall, null, Type.EmptyTypes);
+ il_gen.Emit (OpCodes.Ret);
+
+ Type dynt = tb.CreateType ();
+ dynt.GetMethod ("F", BindingFlags.Public | BindingFlags.Static).Invoke (
+ null, new object [] { Marshal.GetFunctionPointerForDelegate (new FooFoo (Foo)) });
+ }
+#endif
+