Skip to content

Commit

Permalink
(ForNeVeR#354) Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR authored and kant2002 committed Apr 11, 2023
1 parent 65685b4 commit 086871c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
""");
}

0 comments on commit 086871c

Please sign in to comment.