"disable_omit_fp" can now be included in MONO_DEBUG
[mono-project.git] / mcs / tests / gtest-lambda-31.cs
blob8836a96e00b8269afee86c12c563652041512ec8
1 // Compiler options: -optimize
3 // Check lambdas to method group optimization, no lambdas should be created for any code int this test
5 using System;
6 using System.Collections;
7 using System.Linq;
9 class Test
11 static int Prop {
12 get {
13 return 4;
17 public static int Main ()
19 var parsed = from t in new[] { "2" } select int.Parse (t);
20 if (parsed.First () != 2)
21 return 1;
23 var s = new string[] { "x", "a" };
24 Array.Sort (s, (a, b) => String.Compare (a, b));
25 if (s[0] != "a")
26 return 10;
28 if (s[1] != "x")
29 return 11;
31 Func<int> i = () => Prop;
32 if (i () != 4)
33 return 20;
35 var em = new IEnumerable[] { new int[] { 1 } }.Select (l => l.Cast<int> ()).First ().First ();
36 if (em != 1)
37 return 30;
39 Console.WriteLine ("ok");
40 return 0;