Skip to content

Commit

Permalink
(#354) Tests: fix for unsafe class
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Nov 18, 2023
1 parent 118e2d7 commit 862f518
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cesium.CodeGen.Tests/CodeGenNetInteropTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main(void)
public Task FunctionPointerInterop(TargetArchitectureSet architecture) => DoTest(
architecture,
"""
public static class Test
public static unsafe class Test
{
public static int Func(delegate*<int> ptr) => 1;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Module: Primary
Type: <Module>
Methods:
System.Int32 <Module>::myFunc()
IL_0000: ldc.i4.0
IL_0001: ret

System.Int32 <Module>::main()
IL_0000: ldftn System.Int32 <Module>::myFunc()
IL_0006: call System.Int32 Test::Func(method System.Int32 *())
IL_000b: ret

System.Int32 <Module>::<SyntheticEntrypoint>()
Locals:
System.Int32 V_0
IL_0000: call System.Int32 <Module>::main()
IL_0005: stloc.s V_0
IL_0007: ldloc.s V_0
IL_0009: call System.Void Cesium.Runtime.RuntimeHelpers::Exit(System.Int32)
IL_000e: ldloc.s V_0
IL_0010: ret
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Module: Primary
Type: <Module>
Methods:
System.Int32 <Module>::myFunc()
IL_0000: ldc.i4.0
IL_0001: ret

System.Int32 <Module>::main()
IL_0000: ldftn System.Int32 <Module>::myFunc()
IL_0006: call System.Int32 Test::Func(method System.Int32 *())
IL_000b: ret

System.Int32 <Module>::<SyntheticEntrypoint>()
Locals:
System.Int32 V_0
IL_0000: call System.Int32 <Module>::main()
IL_0005: stloc.s V_0
IL_0007: ldloc.s V_0
IL_0009: call System.Void Cesium.Runtime.RuntimeHelpers::Exit(System.Int32)
IL_000e: ldloc.s V_0
IL_0010: ret

0 comments on commit 862f518

Please sign in to comment.