Browse Source

Extend unit test for pointer compound assign

pull/2971/head
ElektroKill 2 years ago
parent
commit
21ddd402c2
No known key found for this signature in database
GPG Key ID: 7E3C5C084E40E3EC
  1. 15
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs

15
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs

@ -4586,6 +4586,21 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -4586,6 +4586,21 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
return *(ptr++);
}
public unsafe int PostIncrementOfSmallIntegerPointerDereference(byte* ptr)
{
return (*ptr)++ * (*ptr)++;
}
public unsafe int PreIncrementOfSmallIntegerPointerDereference(byte* ptr)
{
return ++(*ptr) * ++(*ptr);
}
public unsafe int CompoundAssignSmallIntegerPointerDereference(byte* ptr)
{
return (*ptr += 5) * (*ptr += 5);
}
public int PostDecrementInstanceField()
{
return M().Field--;

Loading…
Cancel
Save