diff --git a/Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs b/Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs index a1ad6729..18a92ee9 100644 --- a/Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs +++ b/Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs @@ -73,10 +73,39 @@ int main(void) [InlineData(TargetArchitectureSet.Dynamic)] [InlineData(TargetArchitectureSet.Bit64)] [InlineData(TargetArchitectureSet.Bit32)] + [InlineData(TargetArchitectureSet.Wide)] public Task PointerFunctionSignature(TargetArchitectureSet arch) => DoTest(arch, """ int foo(void *x) { return 0; } +"""); + + [Theory] + [InlineData(TargetArchitectureSet.Dynamic)] + [InlineData(TargetArchitectureSet.Bit64)] + [InlineData(TargetArchitectureSet.Bit32)] + [InlineData(TargetArchitectureSet.Wide)] + public Task FunctionPointerParameter(TargetArchitectureSet arch) => DoTest(arch, """ +typedef void (*func)(int, int); +typedef void (*v_func)(void); + +int foo(func x) { return 0; } +int v_foo(v_func x) { return 0; } +"""); + // TODO: empty-paren-func ptr + // TODO: vararg-func ptr + + [Theory] + [InlineData(TargetArchitectureSet.Dynamic)] + [InlineData(TargetArchitectureSet.Bit64)] + [InlineData(TargetArchitectureSet.Bit32)] + [InlineData(TargetArchitectureSet.Wide)] + public Task FunctionPointerStructMember(TargetArchitectureSet arch) => DoTest(arch, """ +typedef void (*func)(int); +struct Foo +{ + func x; +}; """); }