New test.
authorMartin Baulig <martin@novell.com>
Wed, 4 Oct 2006 20:51:26 +0000 (20:51 -0000)
committerMartin Baulig <martin@novell.com>
Wed, 4 Oct 2006 20:51:26 +0000 (20:51 -0000)
svn path=/trunk/mcs/; revision=66269

1  2 
mcs/tests/gtest-anon-29.cs

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c258cd5c846a1b2651da68879648b292bf0e2714
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,27 @@@
++// Compiler options: /unsafe
++using System;
++using System.Collections.Generic;
++
++unsafe class Test
++{
++      public static void Main ()
++      {
++              foreach (int item in GetItems ()) {
++                      Console.WriteLine (item);
++              }
++      }
++
++      public static unsafe int GetItem ()
++      {
++              byte[] value = new byte[] { 0xDE, 0xAD, 0xBE, 0xEF };
++
++              fixed (byte* valueptr = value) {
++                      return *(int*) valueptr;
++              }
++      }
++
++      public static IEnumerable<int> GetItems ()
++      {
++              yield return GetItem ();
++      }
++}