diff options
author | Marek Safar <marek.safar@gmail.com> | 2008-10-01 15:06:26 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2008-10-01 15:06:26 +0400 |
commit | 33028b1a2c0d0345efc3639f3b33d74dc96daf62 (patch) | |
tree | e71f9f0a298ae485cbe43fcb760611cbd032547e /mcs/tests/gtest-416.cs | |
parent | 93d04fc148f09e4b71f9e6bf8b090b6119311d80 (diff) | |
parent | 902af77eaa5beaf3797d85fd4cfbe351a883835d (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.cs | 43 |
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; + } + } +} + |