Skip to content

Commit

Permalink
(#354) CodeGen: add an integration test for function pointers inside …
Browse files Browse the repository at this point in the history
…of a struct
  • Loading branch information
ForNeVeR committed Nov 21, 2023
1 parent 193c090 commit 44c0f1a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ typedef struct
{
hostFunc foo;
} foo;
"""); // TODO: Check if the resulting field signature works on CLR at all
""");
}
4 changes: 4 additions & 0 deletions Cesium.IntegrationTests/Cesium.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
<ProjectReference Include="..\Cesium.Test.Framework\Cesium.Test.Framework.csproj" />
</ItemGroup>

<ItemGroup>
<ClCompile Include="pointers\pointers_functions.c" />
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions Cesium.IntegrationTests/pointers/pointers_functions.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
typedef int (*func)(void);
typedef int (*hostFunc)(func);
typedef struct
{
hostFunc foo;
} foo;

int main(void)
{
foo x;
return 42;
}

0 comments on commit 44c0f1a

Please sign in to comment.