2010-02-20 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / tests / gtest-416.cs
bloba08d1636ddc2f9dffeb22b1b11056afe4ad8f169
1 // Compiler options: -unsafe
3 using System;
5 namespace Bug
7 unsafe struct Demo
9 fixed bool test [4];
11 bool Fixed ()
13 fixed (bool* data_ptr = test)
15 return true;
19 static bool Foo (int [] data)
21 fixed (int* data_ptr = data)
23 return data_ptr == null ? true : false;
27 public static int Main ()
29 if (!Foo (null))
30 return 1;
32 if (!Foo (new int [0]))
33 return 2;
35 if (!new Demo().Fixed ())
36 return 3;
38 Console.WriteLine ("OK");
39 return 0;