New tests.
authorMarek Safar <marek.safar@gmail.com>
Mon, 29 Dec 2008 11:28:50 +0000 (11:28 -0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 29 Dec 2008 11:28:50 +0000 (11:28 -0000)
svn path=/trunk/mcs/; revision=122181

mcs/tests/gtest-anontype-11.cs [new file with mode: 0644]
mcs/tests/gtest-exmethod-23.cs [new file with mode: 0644]
mcs/tests/test-697.cs
mcs/tests/test-698.cs [new file with mode: 0644]
mcs/tests/ver-il-gmcs.xml

diff --git a/mcs/tests/gtest-anontype-11.cs b/mcs/tests/gtest-anontype-11.cs
new file mode 100644 (file)
index 0000000..a3c7e50
--- /dev/null
@@ -0,0 +1,44 @@
+// Compiler options: -checked
+
+using System;
+
+internal sealed class Alpha
+{
+       public Alpha (string value)
+       {
+               m_name = value;
+       }
+
+       public override int GetHashCode ()
+       {
+               return int.MaxValue & m_name.GetHashCode ();
+       }
+
+       private string m_name;
+}
+
+internal sealed class Beta
+{
+       public Beta (string value)
+       {
+               m_address = value;
+       }
+
+       public override int GetHashCode ()
+       {
+               return int.MaxValue & m_address.GetHashCode ();
+       }
+
+       private string m_address;
+}
+
+internal static class Program
+{
+       private static int Main ()
+       {
+               var a = new { First = new Alpha ("joe bob"), Second = new Beta ("main street") };
+               Console.WriteLine ("hash = {0}", a.GetHashCode ());
+               return 0;
+       }
+} 
+
diff --git a/mcs/tests/gtest-exmethod-23.cs b/mcs/tests/gtest-exmethod-23.cs
new file mode 100644 (file)
index 0000000..fcd27f2
--- /dev/null
@@ -0,0 +1,12 @@
+// Compiler options: -nostdlib -noconfig -r:mscorlib.dll -r:System.Core.dll
+
+public static class T
+{
+       public static void A (this string v, int a)
+       {
+       }
+
+       public static void Main ()
+       {
+       }
+}
index 3f6aac77a014fc699619c6f1558419a0f610d99b..c63c6ea658644d398ab9b615ebfeb7776d31f7c5 100644 (file)
@@ -1,4 +1,7 @@
+// Compiler options: -codepage:utf8\r
+\r
 // Tests ignorance of UTF-8 header in the middle of the file\r
+// ->|\r
 using  System\uFEFF;\r
 \r
 public class C\r
diff --git a/mcs/tests/test-698.cs b/mcs/tests/test-698.cs
new file mode 100644 (file)
index 0000000..e58d3db
--- /dev/null
@@ -0,0 +1,16 @@
+// Compiler options: -unsafe
+
+struct Foo
+{
+       public int i;
+}
+
+public unsafe class test
+{
+       static Foo* pFoo;
+
+       public static void Main ()
+       {
+               int* pi = &pFoo->i;
+       }
+}
index 4055804f1f915aa397643b074e8845565199e77e..fd51635c97a45ffb44bd6abd0e5bc6301e76e0a1 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-anontype-11.cs">
+    <type name="Alpha">
+      <method name="Void .ctor(String)">
+        <size>14</size>
+      </method>
+      <method name="Int32 GetHashCode()">
+        <size>18</size>
+      </method>
+    </type>
+    <type name="Beta">
+      <method name="Void .ctor(String)">
+        <size>14</size>
+      </method>
+      <method name="Int32 GetHashCode()">
+        <size>18</size>
+      </method>
+    </type>
+    <type name="Program">
+      <method name="Int32 Main()">
+        <size>49</size>
+      </method>
+    </type>
+    <type name="&lt;&gt;__AnonType0`2[&lt;First&gt;__T,&lt;Second&gt;__T]">
+      <method name="Void .ctor(&lt;First&gt;__T, &lt;Second&gt;__T)">
+        <size>21</size>
+      </method>
+      <method name="&lt;First&gt;__T get_First()">
+        <size>7</size>
+      </method>
+      <method name="&lt;Second&gt;__T get_Second()">
+        <size>7</size>
+      </method>
+      <method name="Boolean Equals(System.Object)">
+        <size>69</size>
+      </method>
+      <method name="Int32 GetHashCode()">
+        <size>86</size>
+      </method>
+      <method name="System.String ToString()">
+        <size>108</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-autoproperty-01.cs">
     <type name="Test">
       <method name="Void .ctor()">
       </method>
     </type>
   </test>
+  <test name="gtest-exmethod-23.cs">
+    <type name="T">
+      <method name="Void A(System.String, Int32)">
+        <size>1</size>
+      </method>
+      <method name="Void Main()">
+        <size>1</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-friend-01.cs">
     <type name="Test">
       <method name="Void .ctor()">
       </method>
     </type>
   </test>
+  <test name="test-698.cs">
+    <type name="test">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Void Main()">
+        <size>12</size>
+      </method>
+    </type>
+  </test>
   <test name="test-7.cs">
     <type name="Mine.MyBoolean">
       <method name="Void .ctor()">