Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

36 lines
524 B
C#

// Compiler options: -unsafe
using System;
namespace MonoPointerBugTest
{
struct MyStructure
{
int q;
int z;
int a;
}
class Program
{
public static int Main ()
{
unsafe {
MyStructure structure = new MyStructure ();
MyStructure* pointer1 = &structure;
MyStructure* pointer2 = pointer1;
//on the Mac this works like: pointer2++;
pointer2 += 10;
int difference = (int) ((byte*) pointer2 - (byte*) pointer1);
if (difference != 120)
return 1;
return 0;
}
}
}
}