New tests.
authorMarek Safar <marek.safar@gmail.com>
Mon, 5 Jan 2009 10:11:48 +0000 (10:11 -0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 5 Jan 2009 10:11:48 +0000 (10:11 -0000)
svn path=/trunk/mcs/; revision=122426

mcs/tests/gtest-exmethod-24-lib.cs [new file with mode: 0644]
mcs/tests/gtest-exmethod-24.cs [new file with mode: 0644]
mcs/tests/gtest-exmethod-25-lib.cs [new file with mode: 0644]
mcs/tests/gtest-exmethod-25.cs [new file with mode: 0644]
mcs/tests/ver-il-gmcs.xml

diff --git a/mcs/tests/gtest-exmethod-24-lib.cs b/mcs/tests/gtest-exmethod-24-lib.cs
new file mode 100644 (file)
index 0000000..71dd660
--- /dev/null
@@ -0,0 +1,14 @@
+// Compiler options: -target:library
+
+using System.Runtime.CompilerServices;
+
+namespace lib1
+{
+       internal static class Foo
+       {
+               // It compiles fine, if I make this a non-extension-method:
+               public static void Extend (this string aString)
+               {
+               }
+       }
+}
diff --git a/mcs/tests/gtest-exmethod-24.cs b/mcs/tests/gtest-exmethod-24.cs
new file mode 100644 (file)
index 0000000..3a7f48f
--- /dev/null
@@ -0,0 +1,10 @@
+// Compiler options: -r:gtest-exmethod-24-lib.dll
+
+using lib1;
+
+public class Bar
+{
+       public static void Main ()
+       {
+       }
+}
diff --git a/mcs/tests/gtest-exmethod-25-lib.cs b/mcs/tests/gtest-exmethod-25-lib.cs
new file mode 100644 (file)
index 0000000..c599e12
--- /dev/null
@@ -0,0 +1,15 @@
+// Compiler options: -target:library
+
+using System.Runtime.CompilerServices;
+
+[assembly:InternalsVisibleTo ("gtest-exmethod-25")]
+
+namespace lib1
+{
+       static class Foo
+       {
+               internal static void Extend (this string aString)
+               {
+               }
+       }
+}
diff --git a/mcs/tests/gtest-exmethod-25.cs b/mcs/tests/gtest-exmethod-25.cs
new file mode 100644 (file)
index 0000000..d12f50b
--- /dev/null
@@ -0,0 +1,11 @@
+// Compiler options: -r:gtest-exmethod-25-lib.dll
+
+using lib1;
+
+public class Bar
+{
+       public static void Main ()
+       {
+               "a".Extend ();
+       }
+}
index 0aa41aa75512345b31db9aeb5aa279abf7b30042..16f07a9b6bc6e71e6d4667a0add2bb18f142ed8e 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-exmethod-24.cs">
+    <type name="Bar">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Void Main()">
+        <size>1</size>
+      </method>
+    </type>
+  </test>
+  <test name="gtest-exmethod-25.cs">
+    <type name="Bar">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Void Main()">
+        <size>11</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-friend-01.cs">
     <type name="Test">
       <method name="Void .ctor()">