New tests.
authorMarek Safar <marek.safar@gmail.com>
Wed, 28 Oct 2009 18:04:48 +0000 (18:04 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 28 Oct 2009 18:04:48 +0000 (18:04 -0000)
svn path=/trunk/mcs/; revision=144959

mcs/tests/gtest-etree-01.cs
mcs/tests/gtest-etree-02.cs
mcs/tests/ver-il-gmcs.xml

index b7b9b4657513b2f4f7438c306cb3c20d7d26c036..979badc22930b1494d6e9c2d9287e992aa35ccbe 100644 (file)
@@ -1679,8 +1679,10 @@ class Tester
        {
                string s = "localvar";
                Expression<Func<string>> e9 = () => s;
+               s = "changed";
+
                AssertNodeType (e9, ExpressionType.MemberAccess);
-               Assert ("localvar", e9.Compile ().Invoke ());
+               Assert ("changed", e9.Compile ().Invoke ());
        }
        
        void MemberInitTest ()
@@ -2400,6 +2402,15 @@ class Tester
                Assert (2, e.Compile ().Invoke ().Compile ().Invoke ());
        }
 
+       void QuoteTest_2 ()
+       {
+               Expression<Func<string, Expression<Func<string>>>> e = (string s) => () => s;
+               AssertNodeType (e, ExpressionType.Quote);
+               
+               // Blocked by https://bugzilla.novell.com/show_bug.cgi?id=550722
+               //Assert ("data", e.Compile ().Invoke ("data").Compile ().Invoke ());
+       }
+       
        void RightShiftTest ()
        {
                Expression<Func<ulong, short, ulong>> e = (ulong a, short b) => a >> b;
index d2d522e543c871ffa7f94f90dbc30ce82d305a9e..681fac947498abfd72e6e53b9bb7c9e5de270a6c 100644 (file)
@@ -6,8 +6,14 @@ class M
        public static void Foo<T> (Expression<Func<T, T>> x)
        {
        }
+       
+       static string Param (string b)
+       {
+               Expression<Func<string, Expression<Func<string>>>> e = (string s) => () => b;
+               return e.Compile () ("-##54!2").Compile () ();
+       }
 
-       public static void Main ()
+       public static int Main ()
        {
                Foo<int> ((i) => i);
 
@@ -15,6 +21,11 @@ class M
 
                Expression<Func<int, int>> func = (i) => i;
                Foo (func);
+               
+               if (Param ("my test") != "my test")
+                       return 1;
+               
+               return 0;
        }
 }
 
index fd3e14f34abf2eac3e47076a08ca853a5e11a56d..906a6a02284c1a996080b39363bcd7223c6ed5d6 100644 (file)
         <size>63</size>
       </method>
       <method name="Void MemberAccessTest_9()">
-        <size>80</size>
+        <size>91</size>
       </method>
       <method name="Void MemberInitTest()">
         <size>302</size>
       <method name="Void LambdaTest()">
         <size>89</size>
       </method>
-    </type>
-    <type name="Tester+&lt;MemberAccessTest&gt;c__AnonStorey2">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-    <type name="Tester+&lt;MemberAccessTest_3&gt;c__AnonStorey3">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-    <type name="Tester+&lt;MemberAccessTest_4&gt;c__AnonStorey4">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-    <type name="Tester+&lt;MemberAccessTest_6&gt;c__AnonStorey5">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-    <type name="Tester+&lt;MemberAccessTest_9&gt;c__AnonStorey6">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-    <type name="Tester">
       <method name="Void EqualTest_15()">
         <size>159</size>
       </method>
       <method name="Void RightShiftTest_5()">
         <size>152</size>
       </method>
+      <method name="Void QuoteTest_2()">
+        <size>63</size>
+      </method>
+    </type>
+    <type name="Tester+&lt;MemberAccessTest&gt;c__AnonStorey1">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="Tester+&lt;MemberAccessTest_3&gt;c__AnonStorey2">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="Tester+&lt;MemberAccessTest_4&gt;c__AnonStorey3">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="Tester+&lt;MemberAccessTest_6&gt;c__AnonStorey4">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="Tester+&lt;MemberAccessTest_9&gt;c__AnonStorey5">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
     </type>
   </test>
   <test name="gtest-etree-02.cs">
       <method name="Void Foo[T](System.Linq.Expressions.Expression`1[System.Func`2[T,T]])">
         <size>1</size>
       </method>
-      <method name="Void Main()">
-        <size>129</size>
+      <method name="System.String Param(System.String)">
+        <size>114</size>
+      </method>
+      <method name="Int32 Main()">
+        <size>157</size>
+      </method>
+    </type>
+    <type name="M+&lt;Param&gt;c__AnonStorey0">
+      <method name="Void .ctor()">
+        <size>7</size>
       </method>
     </type>
   </test>