Tests: Add References test
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
<Compile Remove="TestSources\GenericTypes.cs" />
|
<Compile Remove="TestSources\GenericTypes.cs" />
|
||||||
<Compile Remove="TestSources\Methods.cs" />
|
<Compile Remove="TestSources\Methods.cs" />
|
||||||
<Compile Remove="TestSources\Properties.cs" />
|
<Compile Remove="TestSources\Properties.cs" />
|
||||||
|
<Compile Remove="TestSources\References.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
<Content Include="TestSources\GenericTypes.cs" />
|
<Content Include="TestSources\GenericTypes.cs" />
|
||||||
<Content Include="TestSources\Methods.cs" />
|
<Content Include="TestSources\Methods.cs" />
|
||||||
<Content Include="TestSources\Properties.cs" />
|
<Content Include="TestSources\Properties.cs" />
|
||||||
|
<Content Include="TestSources\References.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
29
Il2CppTests/TestSources/References.cs
Normal file
29
Il2CppTests/TestSources/References.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Il2CppTests.TestSources
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0169
|
||||||
|
internal class Test
|
||||||
|
{
|
||||||
|
private float floatField;
|
||||||
|
|
||||||
|
public void MethodWithRefParameters(int a, ref int b, int c, ref int d) {}
|
||||||
|
|
||||||
|
// In parameters were introduced in C# 7.2
|
||||||
|
public void MethodWithInRefOut(in int a, ref int b, out int c) => c = 1;
|
||||||
|
|
||||||
|
public ref float MethodWithRefReturnType() => ref floatField;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ref structs were introduced in C# 7.2 - creates IsByRefLike attribute on type in assembly
|
||||||
|
// Attribute doesn't seem to be retained by IL2CPP?
|
||||||
|
public ref struct RefStruct
|
||||||
|
{
|
||||||
|
private int structField1;
|
||||||
|
}
|
||||||
|
#pragma warning restore CS0169
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user