Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2007-10-04 23:06:54 +0400
committerMarek Safar <marek.safar@gmail.com>2007-10-04 23:06:54 +0400
commit175d5b48fefb245554e5ef095b168a4452180a40 (patch)
treeed9a6a7536cc88717895944397032117494a8300 /mcs/tests/test-591.cs
parentcd45b6783fe054c7d525b82d31beb400c27ae1c8 (diff)
New test for #330069
svn path=/trunk/mcs/; revision=86899
Diffstat (limited to 'mcs/tests/test-591.cs')
-rw-r--r--mcs/tests/test-591.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/mcs/tests/test-591.cs b/mcs/tests/test-591.cs
new file mode 100644
index 00000000000..a08d1636ddc
--- /dev/null
+++ b/mcs/tests/test-591.cs
@@ -0,0 +1,43 @@
+// Compiler options: -unsafe
+
+using System;
+
+namespace Bug
+{
+ unsafe struct Demo
+ {
+ fixed bool test [4];
+
+ bool Fixed ()
+ {
+ fixed (bool* data_ptr = test)
+ {
+ return true;
+ }
+ }
+
+ static bool Foo (int [] data)
+ {
+ fixed (int* data_ptr = data)
+ {
+ return data_ptr == null ? true : false;
+ }
+ }
+
+ public static int Main ()
+ {
+ if (!Foo (null))
+ return 1;
+
+ if (!Foo (new int [0]))
+ return 2;
+
+ if (!new Demo().Fixed ())
+ return 3;
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+ }
+}
+