Merge pull request #4928 from kumpera/ptr_to_struct_intrinsic
[mono.git] / mcs / tests / test-409.cs
1 // Compiler options: -unsafe
2
3 //
4 // Test for http://bugzilla.ximian.com/show_bug.cgi?id=62263
5 //
6 // We need to make sure that pointer arth uses the size of X
7 // not the size of X*
8 //
9
10 using System;
11 unsafe struct X {
12         int x, y, z;
13         
14         public static int Main ()
15         {
16                 X* foo = null;
17                 
18                 if ((int) (foo + 1) != sizeof (X))
19                         return 1;
20                 return 0;
21         }
22 }