Author: gert
Date: 2008-01-12 09:28:43 -0500 (Sat, 12 Jan 2008)
New Revision: 92735

Added:
   trunk/gert/standalone/bug348076/
   trunk/gert/standalone/bug348076/default.build
   trunk/gert/standalone/bug348076/test.cs
Log:
Added test for bug #348076.


Added: trunk/gert/standalone/bug348076/default.build
===================================================================
--- trunk/gert/standalone/bug348076/default.build       2008-01-12 14:26:09 UTC 
(rev 92734)
+++ trunk/gert/standalone/bug348076/default.build       2008-01-12 14:28:43 UTC 
(rev 92735)
@@ -0,0 +1,22 @@
+<project name="bug348076" default="rebuild">
+       <include buildfile="../../build/common.build" />
+       
+       <property name="frameworks" 
value="mono-1.0,mono-2.0,mono-3.5,net-2.0,net-3.5" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.dll" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="run-test" depends="init">
+               <csc target="library" define="${csc.defines}" output="test.dll" 
unsafe="true" warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+</project>


Property changes on: trunk/gert/standalone/bug348076/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug348076/test.cs
===================================================================
--- trunk/gert/standalone/bug348076/test.cs     2008-01-12 14:26:09 UTC (rev 
92734)
+++ trunk/gert/standalone/bug348076/test.cs     2008-01-12 14:28:43 UTC (rev 
92735)
@@ -0,0 +1,36 @@
+using System;
+using System.Runtime.InteropServices;
+
+[StructLayout (LayoutKind.Sequential, Pack = 1)]
+public unsafe struct xxx
+{
+       internal fixed byte zzz [5];
+}
+
+internal class RedSkyTimeCode
+{
+       public unsafe void CopyTo (xxx* dest)
+       {
+               fixed (ulong* p = &_rep) {
+                       byte* pb = (byte*) p;
+                       dest->zzz [0] = pb [0];
+                       dest->zzz [1] = pb [1];
+                       dest->zzz [2] = pb [2];
+                       dest->zzz [3] = pb [3];
+                       dest->zzz [4] = pb [4];
+               }
+       }
+
+       public static unsafe void Convert (xxx* src, ulong* dest)
+       {
+               byte* pb = (byte*) dest;
+               *dest = 0L;
+               pb [0] = src->zzz [0];
+               pb [1] = src->zzz [1];
+               pb [2] = src->zzz [2];
+               pb [3] = src->zzz [3];
+               pb [4] = src->zzz [4];
+       }
+
+       private ulong _rep;
+}


Property changes on: trunk/gert/standalone/bug348076/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to