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>2008-10-01 15:06:26 +0400
committerMarek Safar <marek.safar@gmail.com>2008-10-01 15:06:26 +0400
commit33028b1a2c0d0345efc3639f3b33d74dc96daf62 (patch)
treee71f9f0a298ae485cbe43fcb760611cbd032547e /mcs/tests/gtest-416.cs
parent93d04fc148f09e4b71f9e6bf8b090b6119311d80 (diff)
parent902af77eaa5beaf3797d85fd4cfbe351a883835d (diff)
New tests, updates.
svn path=/trunk/mcs/; revision=114555
Diffstat (limited to 'mcs/tests/gtest-416.cs')
-rw-r--r--mcs/tests/gtest-416.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/mcs/tests/gtest-416.cs b/mcs/tests/gtest-416.cs
new file mode 100644
index 00000000000..a08d1636ddc
--- /dev/null
+++ b/mcs/tests/gtest-416.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;
+ }
+ }
+}
+